Skip to content

Commit 37084ad

Browse files
authored
Add Cloud Configuration section to Identity readme (Azure#20373)
1 parent 29a1e09 commit 37084ad

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sdk/identity/azure-identity/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,22 @@ default_credential = DefaultAzureCredential()
220220
client = SecretClient("https://my-vault.vault.azure.net", default_credential)
221221
```
222222

223+
## Cloud Configuration
224+
Credentials default to authenticating to the Azure Active Directory endpoint for
225+
Azure Public Cloud. To access resources in other clouds, such as Azure Government
226+
or a private cloud, configure credentials with the `authority` argument.
227+
[AzureAuthorityHosts](https://aka.ms/azsdk/python/identity/docs#azure.identity.AzureAuthorityHosts)
228+
defines authorities for well-known clouds:
229+
```py
230+
from azure.identity import AzureAuthorityHosts
231+
232+
DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_GOVERNMENT)
233+
```
234+
Not all credentials require this configuration. Credentials which authenticate
235+
through a development tool, such as `AzureCliCredential`, use that tool's
236+
configuration. Similarly, `VisualStudioCodeCredential` accepts an `authority`
237+
argument but defaults to the authority matching VS Code's "Azure: Cloud" setting.
238+
223239
## Credential Classes
224240

225241
### Authenticating Azure Hosted Applications

0 commit comments

Comments
 (0)