Skip to content

Commit

Permalink
Add Cloud Configuration section to Identity readme (Azure#20373)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored and hildurhodd committed Aug 26, 2021
1 parent 70d42c3 commit b68d948
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 b68d948

Please sign in to comment.