@@ -28,7 +28,7 @@ namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
28
28
/// A record of metadata necessary to manage assets in a specific azure cloud, including necessary endpoints,
29
29
/// location fo service-specific endpoints, and information for bootstrapping authentication
30
30
/// </summary>
31
- [ Serializable ]
31
+ [ Serializable ]
32
32
public class AzureEnvironment : IAzureEnvironment , IEquatable < AzureEnvironment >
33
33
{
34
34
private const string ArmMetadataEnvVariable = "ARM_CLOUD_METADATA_URL" ;
@@ -238,7 +238,7 @@ private static async Task<List<ArmMetadata>> InitializeEnvironmentsFromArm(strin
238
238
/// <param name="azureEnvironments">Collection of AzureEnvironments</param>
239
239
private static void SetExtendedProperties ( IDictionary < string , AzureEnvironment > azureEnvironments )
240
240
{
241
- if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureCloud ) )
241
+ if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureCloud ) )
242
242
{
243
243
azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . OperationalInsightsEndpoint , AzureEnvironmentConstants . AzureOperationalInsightsEndpoint ) ;
244
244
azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . OperationalInsightsEndpointResourceId , AzureEnvironmentConstants . AzureOperationalInsightsEndpointResourceId ) ;
@@ -248,28 +248,36 @@ private static void SetExtendedProperties(IDictionary<string, AzureEnvironment>
248
248
azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . AzureAttestationServiceEndpointResourceId , AzureEnvironmentConstants . AzureAttestationServiceEndpointResourceId ) ;
249
249
azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . AzureSynapseAnalyticsEndpointSuffix , AzureEnvironmentConstants . AzureSynapseAnalyticsEndpointSuffix ) ;
250
250
azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . AzureSynapseAnalyticsEndpointResourceId , AzureEnvironmentConstants . AzureSynapseAnalyticsEndpointResourceId ) ;
251
+ azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointResourceId , AzureEnvironmentConstants . AzureManagedHsmServiceEndpointResourceId ) ;
252
+ azureEnvironments [ EnvironmentName . AzureCloud ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointSuffix , AzureEnvironmentConstants . AzureManagedHsmDnsSuffix ) ;
251
253
}
252
254
253
- if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureChinaCloud ) )
255
+ if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureChinaCloud ) )
254
256
{
255
257
azureEnvironments [ EnvironmentName . AzureChinaCloud ] . SetProperty ( ExtendedEndpoint . AnalysisServicesEndpointSuffix , AzureEnvironmentConstants . ChinaAnalysisServicesEndpointSuffix ) ;
256
258
azureEnvironments [ EnvironmentName . AzureChinaCloud ] . SetProperty ( ExtendedEndpoint . AnalysisServicesEndpointResourceId , AzureEnvironmentConstants . ChinaAnalysisServicesEndpointResourceId ) ;
257
259
azureEnvironments [ EnvironmentName . AzureChinaCloud ] . SetProperty ( ExtendedEndpoint . AzureSynapseAnalyticsEndpointSuffix , AzureEnvironmentConstants . ChinaSynapseAnalyticsEndpointSuffix ) ;
258
260
azureEnvironments [ EnvironmentName . AzureChinaCloud ] . SetProperty ( ExtendedEndpoint . AzureSynapseAnalyticsEndpointResourceId , AzureEnvironmentConstants . ChinaSynapseAnalyticsEndpointResourceId ) ;
261
+ azureEnvironments [ EnvironmentName . AzureChinaCloud ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointResourceId , AzureEnvironmentConstants . ChineManagedHsmServiceEndpointResourceId ) ;
262
+ azureEnvironments [ EnvironmentName . AzureChinaCloud ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointSuffix , AzureEnvironmentConstants . ChinaManagedHsmDnsSuffix ) ;
259
263
}
260
264
261
- if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureUSGovernment ) )
265
+ if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureUSGovernment ) )
262
266
{
263
267
azureEnvironments [ EnvironmentName . AzureUSGovernment ] . SetProperty ( ExtendedEndpoint . OperationalInsightsEndpoint , AzureEnvironmentConstants . USGovernmentOperationalInsightsEndpoint ) ;
264
268
azureEnvironments [ EnvironmentName . AzureUSGovernment ] . SetProperty ( ExtendedEndpoint . OperationalInsightsEndpointResourceId , AzureEnvironmentConstants . USGovernmentOperationalInsightsEndpointResourceId ) ;
265
269
azureEnvironments [ EnvironmentName . AzureUSGovernment ] . SetProperty ( ExtendedEndpoint . AnalysisServicesEndpointSuffix , AzureEnvironmentConstants . USGovernmentAnalysisServicesEndpointSuffix ) ;
266
270
azureEnvironments [ EnvironmentName . AzureUSGovernment ] . SetProperty ( ExtendedEndpoint . AnalysisServicesEndpointResourceId , AzureEnvironmentConstants . USGovernmentAnalysisServicesEndpointResourceId ) ;
271
+ azureEnvironments [ EnvironmentName . AzureUSGovernment ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointResourceId , AzureEnvironmentConstants . USGovernmeneManagedHsmServiceEndpointResourceId ) ;
272
+ azureEnvironments [ EnvironmentName . AzureUSGovernment ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointSuffix , AzureEnvironmentConstants . USGovernmentManagedHsmDnsSuffix ) ;
267
273
}
268
274
269
- if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureGermanCloud ) )
275
+ if ( azureEnvironments . ContainsKey ( EnvironmentName . AzureGermanCloud ) )
270
276
{
271
277
azureEnvironments [ EnvironmentName . AzureGermanCloud ] . SetProperty ( ExtendedEndpoint . AnalysisServicesEndpointSuffix , AzureEnvironmentConstants . GermanAnalysisServicesEndpointSuffix ) ;
272
278
azureEnvironments [ EnvironmentName . AzureGermanCloud ] . SetProperty ( ExtendedEndpoint . AnalysisServicesEndpointResourceId , AzureEnvironmentConstants . GermanAnalysisServicesEndpointResourceId ) ;
279
+ azureEnvironments [ EnvironmentName . AzureGermanCloud ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointResourceId , AzureEnvironmentConstants . GermanAzureManagedHsmServiceEndpointResourceId ) ;
280
+ azureEnvironments [ EnvironmentName . AzureGermanCloud ] . SetProperty ( ExtendedEndpoint . ManagedHsmServiceEndpointSuffix , AzureEnvironmentConstants . GermanManagedHsmDnsSuffix ) ;
273
281
}
274
282
}
275
283
@@ -305,11 +313,11 @@ private static AzureEnvironment MapArmToAzureEnvironment(ArmMetadata armMetadata
305
313
ContainerRegistryEndpointSuffix = armMetadata . Suffixes . AcrLoginServer
306
314
} ;
307
315
308
- // There are mismatches between metadata built in Azure PowerShell/CLI and from ARM endpoint.
316
+ // There are mismatches between metadata built in Azure PowerShell/CLI and from ARM endpoint.
309
317
// Considering compatibility, below hard coded logic accommodates those mismatches
310
318
// SqlDatabaseDnsSuffix requires value leading with period
311
319
// ServiceManagementUrl as audience needs to end with slash
312
- if ( azureEnvironment . SqlDatabaseDnsSuffix != null && ! azureEnvironment . SqlDatabaseDnsSuffix . StartsWith ( "." ) )
320
+ if ( azureEnvironment . SqlDatabaseDnsSuffix != null && ! azureEnvironment . SqlDatabaseDnsSuffix . StartsWith ( "." ) )
313
321
{
314
322
azureEnvironment . SqlDatabaseDnsSuffix = "." + azureEnvironment . SqlDatabaseDnsSuffix ;
315
323
}
@@ -635,6 +643,8 @@ public static class ExtendedEndpoint
635
643
{
636
644
public const string OperationalInsightsEndpointResourceId = "OperationalInsightsEndpointResourceId" ,
637
645
OperationalInsightsEndpoint = "OperationalInsightsEndpoint" ,
646
+ ManagedHsmServiceEndpointSuffix = "ManagedHsmServiceEndpointSuffix" ,
647
+ ManagedHsmServiceEndpointResourceId = "ManagedHsmServiceEndpointResourceId" ,
638
648
AnalysisServicesEndpointSuffix = "AzureAnalysisServicesEndpointSuffix" ,
639
649
AnalysisServicesEndpointResourceId = "AnalysisServicesEndpointResourceId" ,
640
650
AzureAttestationServiceEndpointSuffix = "AzureAttestationServiceEndpointSuffix" ,
0 commit comments