-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloud.Configuration support for endpoints (AzureChinaCloud, AzureGovernmentCloud, AzurePrivateCloud) #235
Comments
Hi @mblaschke |
Thank you for raising this issue. We definitely have some work to do to simplify sovereign cloud support. However, rather than having a cloud configuration document baked into the SDKs, I would rather rely on the cloud endpoints that are advertised in the OpenID connect configuration endpoint.
When used as a "tenanted endpoint" it can identify which sovereign cloud a tenant is hosted in automatically.
This allows developers to build multi-tenant applications without having to know in advance what clouds those tenants live in. |
@darrelmiller Please stick to the way like azure-sdk-for-go is doing it otherwise it increases the effort to use both SDKs. |
Thanks for the additional feedback. Adding to the conversation as those are questions we're asking ourselves and are trying to get customer evidence to make sure we do the right thing: |
How is this different from now? 🤔 My suggestion is to use the same kind of auto configuration like the azure-sdk-for-go is doing by using something similar like the ResourceManager configuration is injected in https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azcore/arm/arm.go
So all well known service urls are configured by default (AzurePublicCloud, AzureChinaCloud, AzureGovernmentCloud) and can be set via an predefined cloud configuration struct or an own instance and in "worst case" via see documentation here: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azcore/cloud/doc.go for a story description: As a customer i only want to select one cloud config for azure-sdk-for-go and the msgraph-sdk-for-go to ensure that both SDKs are properly configured with only one struct and don't want to configure the right base url for well known clouds 🙂 |
@mblaschke I understand the challenge you have. I agree that it would be helpful to be able to re-use the Azure cloud configuration object to configure the Graph SDKs. I will talk to the team about designing a way take an instance of the Azure cloud object and use it to configure a Graph client. |
@maisarissi any comments on what to do here. |
instead of using
adapter.SetBaseUrl("https://microsoftgraph.chinaclouapi.cn/v1.0")
(related to #26) maybe adapt the way how the azure-sdk-for-go is using cloud.Configuration for configuring endpoints.json representation of cloud.Configuration content for AzurePublicCloud:
which is initialised here: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azcore/arm/arm.go
Inside the client creation (eg
armresoruces
,armauthorization
, ...) the azure-sdk-for-go is using the AzurePublic endpoints by default and overwrites the endpoint if a cloud configuration is passed in the client options:see https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/resources/armresources/zz_generated_client.go#L38
The text was updated successfully, but these errors were encountered: