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

Add AuthenticationScope to ACR ClientOptions #21493

Merged
merged 16 commits into from
Jun 4, 2021

Conversation

annelo-msft
Copy link
Member

@annelo-msft annelo-msft commented Jun 1, 2021

This enables customers to use the SDK to connect to registries in the Azure National Clouds, and provides instructions in the README for doing so. Positive functionality has been confirmed by manual testing, and automated tests for this are tracked by #21556

Fixes #20872

@annelo-msft annelo-msft marked this pull request as ready for review June 4, 2021 17:48
@@ -35,15 +35,37 @@ az acr create --name MyContainerRegistry --resource-group MyResourceGroup --loca

### Authenticate the client

The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication.
The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication. You can set the environment variables `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` to configure `DefaultAzureCredential` to authenticate with AAD. For more information refer to [Azure Identity environment variables](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity#environment-variables) or [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity#defaultazurecredential).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe only EnvironmentCredential will use those environment variables, so depending on the current execution environment or the options passed to DAC, these may be ignored.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't EnvironmentCredential the first the the DAC chain? Are there cases where this could be bypassed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to push our readme's away from documenting using environment variables with the DAC as this requires setting up a service principal. Instead I think service client readme's should document that users can log in through the CLII and link to the Identity readme for more ways to authenticate your dev environment when using the DAC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't EnvironmentCredential the first the the DAC chain? Are there cases where this could be bypassed?

Yes -

public bool ExcludeEnvironmentCredential { get; set; }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schaabs can you point me to an example of a service client README that does this the way you'd like to see it, so I can copy it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to reflect Scott's feedback

@@ -35,15 +35,37 @@ az acr create --name MyContainerRegistry --resource-group MyResourceGroup --loca

### Authenticate the client

The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication.
The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication. You can [authenticate with the Azure CLI](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity#authenticating-via-the-azure-cli) when developing and debugging locally. Please see the [Azure Identity README][identity] for more approaches to authenticating with `DefaultAzureCredential`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@annelo-msft annelo-msft merged commit 1ccd5b3 into Azure:master Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make AAD resource scope match cloud
4 participants