Skip to content

Commit 2d49823

Browse files
committed
Support Microsoft Graph Endpoints for AzureStackCloud
When using the AzureStackCloud environment, the desired Microsoft Graph endpoint/scope might not be one of the hard coded values for PublicCloud, USGovernmentCloud, ChinaCloud, or GermanCloud. If the msGraphEndpoint map doesn't contain an entry for the provided Azure environment, use the ResourceIdentifier value for MicrosoftGraph from the provided Azure environment. This allows users to override the endpoint/scope when needed.
1 parent 471822d commit 2d49823

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/cloud/azureclient.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,5 +263,9 @@ func parseRsaPrivateKey(path string) (*rsa.PrivateKey, error) {
263263
}
264264

265265
func getGraphScope(env azure.Environment) string {
266-
return fmt.Sprintf("%s.default", msGraphEndpoint[env])
266+
endpoint := msGraphEndpoint[env]
267+
if endpoint == "" {
268+
endpoint = env.ResourceIdentifiers.MicrosoftGraph
269+
}
270+
return fmt.Sprintf("%s.default", endpoint)
267271
}

0 commit comments

Comments
 (0)