File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
src/Network/Network/Cortex/VirtualHub Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ public class NewAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
107
107
public override void Execute ( )
108
108
{
109
109
base . Execute ( ) ;
110
+ Dictionary < string , List < string > > auxAuthHeader = null ;
110
111
111
112
if ( this . IsVirtualHubPresent ( this . ResourceGroupName , this . Name ) )
112
113
{
@@ -155,6 +156,19 @@ public override void Execute()
155
156
if ( this . HubVnetConnection != null )
156
157
{
157
158
virtualHub . VirtualNetworkConnections . AddRange ( this . HubVnetConnection ) ;
159
+
160
+ // get auth headers for cross-tenant hubvnet conn
161
+ List < string > resourceIds = new List < string > ( ) ;
162
+ foreach ( var connection in this . HubVnetConnection )
163
+ {
164
+ resourceIds . Add ( connection . RemoteVirtualNetwork . Id ) ;
165
+ }
166
+
167
+ var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
168
+ if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
169
+ {
170
+ auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
171
+ }
158
172
}
159
173
160
174
virtualHub . RouteTable = this . RouteTable ;
@@ -169,7 +183,8 @@ public override void Execute()
169
183
this . ResourceGroupName ,
170
184
this . Name ,
171
185
virtualHub ,
172
- this . Tag ) ) ;
186
+ this . Tag ,
187
+ auxAuthHeader ) ) ;
173
188
} ) ;
174
189
}
175
190
}
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ public override void Execute()
107
107
{
108
108
base . Execute ( ) ;
109
109
PSVirtualHub virtualHubToUpdate = null ;
110
+ Dictionary < string , List < string > > auxAuthHeader = null ;
110
111
111
112
if ( ParameterSetName . Equals ( CortexParameterSetNames . ByVirtualHubObject , StringComparison . OrdinalIgnoreCase ) )
112
113
{
@@ -142,6 +143,19 @@ public override void Execute()
142
143
{
143
144
virtualHubToUpdate . VirtualNetworkConnections = new List < PSHubVirtualNetworkConnection > ( ) ;
144
145
virtualHubToUpdate . VirtualNetworkConnections . AddRange ( this . HubVnetConnection ) ;
146
+
147
+ // get auth headers for cross-tenant hubvnet conn
148
+ List < string > resourceIds = new List < string > ( ) ;
149
+ foreach ( var connection in this . HubVnetConnection )
150
+ {
151
+ resourceIds . Add ( connection . RemoteVirtualNetwork . Id ) ;
152
+ }
153
+
154
+ var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
155
+ if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
156
+ {
157
+ auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
158
+ }
145
159
}
146
160
147
161
//// VirtualHubRouteTable
@@ -166,7 +180,8 @@ public override void Execute()
166
180
this . ResourceGroupName ,
167
181
this . Name ,
168
182
virtualHubToUpdate ,
169
- this . Tag ) ) ;
183
+ this . Tag ,
184
+ auxAuthHeader ) ) ;
170
185
} ) ;
171
186
}
172
187
}
You can’t perform that action at this time.
0 commit comments