Skip to content

Commit

Permalink
Revert "move cloud content to inline initialization" (#19502)
Browse files Browse the repository at this point in the history
This reverts commit 4042dff.
  • Loading branch information
jhendrixMSFT authored Nov 4, 2022
1 parent 4042dff commit a53adbe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
24 changes: 24 additions & 0 deletions sdk/azcore/arm/arm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//go:build go1.16
// +build go1.16

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package arm

import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"

func init() {
cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
Audience: "https://management.core.chinacloudapi.cn",
Endpoint: "https://management.chinacloudapi.cn",
}
cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
Audience: "https://management.core.usgovcloudapi.net",
Endpoint: "https://management.usgovcloudapi.net",
}
cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
Audience: "https://management.core.windows.net/",
Endpoint: "https://management.azure.com",
}
}
26 changes: 3 additions & 23 deletions sdk/azcore/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,15 @@ package cloud
var (
// AzureChina contains configuration for Azure China.
AzureChina = Configuration{
ActiveDirectoryAuthorityHost: "https://login.chinacloudapi.cn/",
Services: map[ServiceName]ServiceConfiguration{
ResourceManager: {
Audience: "https://management.core.chinacloudapi.cn",
Endpoint: "https://management.chinacloudapi.cn",
},
},
ActiveDirectoryAuthorityHost: "https://login.chinacloudapi.cn/", Services: map[ServiceName]ServiceConfiguration{},
}

// AzureGovernment contains configuration for Azure Government.
AzureGovernment = Configuration{
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.us/",
Services: map[ServiceName]ServiceConfiguration{
ResourceManager: {
Audience: "https://management.core.usgovcloudapi.net",
Endpoint: "https://management.usgovcloudapi.net",
},
},
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
}

// AzurePublic contains configuration for Azure Public Cloud.
AzurePublic = Configuration{
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/",
Services: map[ServiceName]ServiceConfiguration{
ResourceManager: {
Audience: "https://management.core.windows.net/",
Endpoint: "https://management.azure.com",
},
},
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
}
)

Expand Down

0 comments on commit a53adbe

Please sign in to comment.