@@ -180,33 +180,33 @@ public static void SetTestSettings()
180180 CredentialHelper . GetTestSettings ( Resource . TestSettings ) ;
181181
182182 vmPowershellCmdlets . RemoveAzureSubscriptions ( ) ;
183- if ( vmPowershellCmdlets . GetAzureEnvironment ( "ussouth" ) . Count > 0 )
183+ var ussouthEnv = vmPowershellCmdlets . GetAzureEnvironment ( "ussouth" ) ;
184+ if ( ussouthEnv != null && ussouthEnv . Count > 0 )
184185 {
185186 Console . WriteLine ( "Removing ussouth environment..." ) ;
186187 vmPowershellCmdlets . RunPSScript ( "Remove-AzureEnvironment -Name ussouth -Force" ) ;
187188 }
188189
189- List < AzureEnvironment > environments = vmPowershellCmdlets . GetAzureEnvironment ( ) ;
190+ List < PSAzureEnvironment > environments = vmPowershellCmdlets . GetAzureEnvironment ( ) ;
190191 var serviceManagementUrl = GetServiceManagementUrl ( CredentialHelper . PublishSettingsFile ) ;
191192
192193 foreach ( var env in environments )
193194 {
194- var envServiceManagementUrl = ( string ) env . Endpoints [ AzureEnvironment . Endpoint . ServiceManagement ] ;
195- if ( ! string . IsNullOrEmpty ( envServiceManagementUrl ) )
195+ if ( ! string . IsNullOrEmpty ( env . ServiceManagementUrl ) )
196196 {
197- if ( envServiceManagementUrl . Equals ( serviceManagementUrl ) )
197+ if ( env . ServiceManagementUrl . Equals ( serviceManagementUrl ) )
198198 {
199199 currentEnvName = env . Name ;
200200 var curEnv = vmPowershellCmdlets . GetAzureEnvironment ( currentEnvName ) [ 0 ] ;
201201 Console . WriteLine ( "Using the existing environment: {0}" , currentEnvName ) ;
202- Console . WriteLine ( "PublichSettingsFileUrl: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . PublishSettingsFileUrl ) ) ;
203- Console . WriteLine ( "ServiceManagement: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . ServiceManagement ) ) ;
204- Console . WriteLine ( "ManagementPortalUrl: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . ManagementPortalUrl ) ) ;
205- Console . WriteLine ( "ActiveDirectory: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . ActiveDirectory ) ) ;
206- Console . WriteLine ( "ActiveDirectoryServiceEndpointResourceId: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . ActiveDirectoryServiceEndpointResourceId ) ) ;
207- Console . WriteLine ( "ResourceManager: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . ResourceManager ) ) ;
208- Console . WriteLine ( "Gallery: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . Gallery ) ) ;
209- Console . WriteLine ( "Graph: {0}" , curEnv . GetEndpoint ( AzureEnvironment . Endpoint . Graph ) ) ;
202+ Console . WriteLine ( "PublichSettingsFileUrl: {0}" , curEnv . PublishSettingsFileUrl ) ;
203+ Console . WriteLine ( "ServiceManagement: {0}" , curEnv . ServiceManagementUrl ) ;
204+ Console . WriteLine ( "ManagementPortalUrl: {0}" , curEnv . ManagementPortalUrl ) ;
205+ Console . WriteLine ( "ActiveDirectory: {0}" , curEnv . ActiveDirectoryAuthority ) ;
206+ Console . WriteLine ( "ActiveDirectoryServiceEndpointResourceId: {0}" , curEnv . ActiveDirectoryServiceEndpointResourceId ) ;
207+ Console . WriteLine ( "ResourceManager: {0}" , curEnv . ResourceManagerUrl ) ;
208+ Console . WriteLine ( "Gallery: {0}" , curEnv . GalleryUrl ) ;
209+ Console . WriteLine ( "Graph: {0}" , curEnv . GalleryUrl ) ;
210210 break ;
211211 }
212212 }
@@ -227,14 +227,14 @@ public static void SetTestSettings()
227227 -GalleryEndpoint {7} `
228228 -GraphEndpoint {8}" ,
229229 TempEnvName ,
230- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . PublishSettingsFileUrl ) ,
230+ prodEnv . PublishSettingsFileUrl ,
231231 serviceManagementUrl ,
232- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . ManagementPortalUrl ) ,
233- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . ActiveDirectory ) ,
234- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . ActiveDirectoryServiceEndpointResourceId ) ,
235- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . ResourceManager ) ,
236- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . Gallery ) ,
237- prodEnv . GetEndpoint ( AzureEnvironment . Endpoint . Graph ) ) ) ;
232+ prodEnv . ManagementPortalUrl ,
233+ prodEnv . ActiveDirectoryAuthority ,
234+ prodEnv . ActiveDirectoryServiceEndpointResourceId ,
235+ prodEnv . ResourceManagerUrl ,
236+ prodEnv . GalleryUrl ,
237+ prodEnv . GalleryUrl ) ) ;
238238
239239 vmPowershellCmdlets . ImportAzurePublishSettingsFile ( CredentialHelper . PublishSettingsFile , TempEnvName ) ;
240240 }
0 commit comments