You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Azure Identity client library for Python - version 1.18.0
9
+
# Azure Identity client library for Python - version 1.19.0
10
10
11
11
12
12
The Azure Identity library provides [Microsoft Entra ID](https://learn.microsoft.com/entra/fundamentals/whatis) ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It provides a set of [`TokenCredential`][token_cred_ref]/[`SupportsTokenInfo`][supports_token_info_ref] implementations, which can be used to construct Azure SDK clients that support Microsoft Entra token authentication.
@@ -68,21 +68,7 @@ The Azure Identity library focuses on OAuth authentication with Microsoft Entra
68
68
69
69
### DefaultAzureCredential
70
70
71
-
`DefaultAzureCredential` is appropriate for most applications that will run in Azure because it combines common production credentials with development credentials. `DefaultAzureCredential` attempts to authenticate via the following mechanisms, in this order, stopping when one succeeds:
72
-
73
-
>Note: `DefaultAzureCredential` is intended to simplify getting started with the library by handling common
74
-
>scenarios with reasonable default behaviors. Developers who want more control or whose scenario
75
-
>isn't served by the default settings should use other credential types.
1.**Environment** - `DefaultAzureCredential` reads account information specified via [environment variables](#environment-variables"environment variables") and uses it to authenticate.
80
-
1.**Workload Identity** - If the application is deployed to Azure Kubernetes Service with Managed Identity enabled, `DefaultAzureCredential` authenticates with it.
81
-
1.**Managed Identity** - If the application is deployed to an Azure host with Managed Identity enabled, `DefaultAzureCredential` authenticates with it.
82
-
1.**Azure CLI** - If a user signed in via the Azure CLI `az login` command, `DefaultAzureCredential` authenticates as that user.
83
-
1.**Azure PowerShell** - If a user signed in via Azure PowerShell's `Connect-AzAccount` command, `DefaultAzureCredential` authenticates as that user.
84
-
1.**Azure Developer CLI** - If the developer authenticated via the Azure Developer CLI `azd auth login` command, `DefaultAzureCredential` authenticates with that account.
85
-
1.**Interactive browser** - If enabled, `DefaultAzureCredential` interactively authenticates a user via the default browser. This credential type is disabled by default.
71
+
`DefaultAzureCredential` simplifies authentication while developing apps that deploy to Azure by combining credentials used in Azure hosting environments with credentials used in local development. For more information, see [DefaultAzureCredential overview][dac_overview].
When enabled, `DefaultAzureCredential` falls back to interactively authenticating via the system's default web browser when no other credential is available.
129
115
130
-
#### Specify a user-assigned managed identity for`DefaultAzureCredential`
116
+
#### Specify a user-assigned managed identity with`DefaultAzureCredential`
131
117
132
118
Many Azure hosts allow the assignment of a user-assigned managed identity. To configure `DefaultAzureCredential` to authenticate a user-assigned managed identity, use the `managed_identity_client_id` keyword argument:
133
119
@@ -139,20 +125,7 @@ Alternatively, set the environment variable `AZURE_CLIENT_ID` to the identity's
139
125
140
126
### Define a custom authentication flow with `ChainedTokenCredential`
141
127
142
-
`DefaultAzureCredential` is generally the quickest way to get started developing applications for Azure. For more advanced scenarios, [ChainedTokenCredential][chain_cred_ref] links multiple credential instances to be tried sequentially when authenticating. It tries each credential in turn until one provides a token or fails to authenticate due to an error.
143
-
144
-
The following example demonstrates creating a credential that first attempts to authenticate using managed identity. The credential falls back to authenticating via the Azure CLI when a managed identity is unavailable. This example uses the `EventHubProducerClient` from the [azure-eventhub][azure_eventhub] client library.
145
-
146
-
```python
147
-
from azure.eventhub import EventHubProducerClient
148
-
from azure.identity import AzureCliCredential, ChainedTokenCredential, ManagedIdentityCredential
While `DefaultAzureCredential` is generally the quickest way to authenticate apps for Azure, you can create a customized chain of credentials to be considered. `ChainedTokenCredential` enables users to combine multiple credential instances to define a customized chain of credentials. For more information, see [ChainedTokenCredential overview][ctc_overview].
These examples demonstrate authenticating `SecretClient` from the [`azure-keyvault-secrets`](https://github.com/Azure/azure-sdk-for-python/tree/azure-identity_1.19.0/sdk/keyvault/azure-keyvault-secrets) library with `ManagedIdentityCredential`.
175
+
176
+
201
177
#### Authenticate with a user-assigned managed identity
202
178
179
+
To authenticate with a user-assigned managed identity, you must specify one of the following IDs for the managed identity.
180
+
181
+
##### Client ID
182
+
183
+
```python
184
+
from azure.identity import ManagedIdentityCredential
@@ -331,7 +333,7 @@ Token caching is a feature provided by the Azure Identity library that allows ap
331
333
- Improve resilience and performance.
332
334
- Reduce the number of requests made to Microsoft Entra ID to obtain access tokens.
333
335
334
-
The Azure Identity library offers both in-memory and persistent disk caching. For more information, see the [token caching documentation](https://github.com/Azure/azure-sdk-for-python/blob/azure-identity_1.18.0/sdk/identity/azure-identity/TOKEN_CACHING.md).
336
+
The Azure Identity library offers both in-memory and persistent disk caching. For more information, see the [token caching documentation](https://github.com/Azure/azure-sdk-for-python/blob/azure-identity_1.19.0/sdk/identity/azure-identity/TOKEN_CACHING.md).
335
337
336
338
## Brokered authentication
337
339
@@ -391,19 +393,21 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
0 commit comments