Skip to content

Commit

Permalink
Add Cloud Configuration section to Identity readme (#20373)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored and iscai-msft committed Sep 29, 2021
1 parent 613a9a7 commit 0679e35
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sdk/identity/azure-identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@ default_credential = DefaultAzureCredential()
client = SecretClient("https://my-vault.vault.azure.net", default_credential)
```

## Cloud Configuration
Credentials default to authenticating to the Azure Active Directory endpoint for
Azure Public Cloud. To access resources in other clouds, such as Azure Government
or a private cloud, configure credentials with the `authority` argument.
[AzureAuthorityHosts](https://aka.ms/azsdk/python/identity/docs#azure.identity.AzureAuthorityHosts)
defines authorities for well-known clouds:
```py
from azure.identity import AzureAuthorityHosts

DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_GOVERNMENT)
```
Not all credentials require this configuration. Credentials which authenticate
through a development tool, such as `AzureCliCredential`, use that tool's
configuration. Similarly, `VisualStudioCodeCredential` accepts an `authority`
argument but defaults to the authority matching VS Code's "Azure: Cloud" setting.

## Credential Classes

### Authenticating Azure Hosted Applications
Expand Down

0 comments on commit 0679e35

Please sign in to comment.