Skip to content
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

Change Request: Add note on how to use package in other Azure clouds in the readme #3353

Closed
ramya-rao-a opened this issue Sep 13, 2021 · 5 comments
Assignees
Labels
architecture board-review Request for an Architectural Board Review

Comments

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 13, 2021

Thank you for contributing to the design guidelines for Azure SDKs. We welcome all discussions and contributions. Since the design guidelines affect the client libraries for all Azure services, we thoroughly discuss and vet any design guideline changes before we incorporate them into the official guidance. This process can take some time, so your patience is appreciated.

** Before submitting, ensure you adjust the title of the issue appropriately **

The Basics

  • Which design guideline is affected?

There is no design/implementation guideline for supporting other clouds.

  • Which target languages are affected?

All

  • Describe the change:

Discussions around this have happened in the past but no guideline was formed yet. This issue is about coming up with one that makes supporting different clouds uniform across the SDK packages.

Reasoning

When a resource's functionality is chunked into small permission sets, third-party apps can be built to request only the permissions that they need to perform their function. In OAuth 2.0, these types of permission sets are called scopes. In the Microsoft identity platform, a permission is represented as a string value. An app requests the permissions it needs by specifying the permission in the scope query parameter. For the purposes of this issue, I will refer to the URL of such requests as the scope string. For more information, please refer to this AAD introduction.

For example, the text analytics scope string for the public Azure cloud is: https://cognitiveservices.azure.com/.default. However, it differs for the US and China sovereign clouds as follows respectively: https://cognitiveservices.azure.us/.default and https://cognitiveservices.azure.cn/.default.

These differences between clouds is not consistent across services. For instance storage uses a unified scope string across all clouds but ARM services use https://management.chinacloudapi.cn for China.

Supporting different clouds in the SDK typically comes down to using the corresponding scope string. However, the guidelines do not explain how to determine the cloud in order for the SDK to use that information to set the corresponding scope string.

Previous discussions:

@ramya-rao-a
Copy link
Contributor Author

cc @AlexGhiondea, @joshfree

@lilyjma
Copy link
Contributor

lilyjma commented Nov 5, 2021

scheduled for 11/9 2-3pm pst

@tg-msft
Copy link
Member

tg-msft commented Nov 9, 2021

For prior art, I think we've had three ways of approaching this:

  1. Services with a global scope across all regions, like Blobs
    We make the scope an internal constant and no public API is exposed.

  2. Services that provide a global discovery endpoint, like KeyVault
    We use automatic discovery under the hood and no public API is exposed.

  3. Services with regional/federated scopes and no discovery, like ACR
    Today we expose a property on the ClientOptions that defaults to the public cloud's scope. In the future we hope to support it via Add cloud configuration support for azure client libraries #1550 (comment).

@deyaaeldeen
Copy link
Member

We agreed on going ahead and working on a design for a way such that the customer can specify the audience cloud either by name for known ones or by a list of configurations. The timeline is not known yet but some libs are going GA early 2022 so having the designs by then would benefit them.

@tg-msft
Copy link
Member

tg-msft commented Nov 9, 2021

Recording[MS INTERNAL ONLY]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture board-review Request for an Architectural Board Review
Projects
None yet
Development

No branches or pull requests

6 participants