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
Copy file name to clipboardExpand all lines: sdk/identity/azure-identity/README.md
+5-30Lines changed: 5 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,21 +59,7 @@ The Azure Identity library focuses on OAuth authentication with Microsoft Entra
59
59
60
60
### DefaultAzureCredential
61
61
62
-
`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:
63
-
64
-
>Note: `DefaultAzureCredential` is intended to simplify getting started with the library by handling common
65
-
>scenarios with reasonable default behaviors. Developers who want more control or whose scenario
66
-
>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.
71
-
1.**Workload Identity** - If the application is deployed to Azure Kubernetes Service with Managed Identity enabled, `DefaultAzureCredential` authenticates with it.
72
-
1.**Managed Identity** - If the application is deployed to an Azure host with Managed Identity enabled, `DefaultAzureCredential` authenticates with it.
73
-
1.**Azure CLI** - If a user signed in via the Azure CLI `az login` command, `DefaultAzureCredential` authenticates as that user.
74
-
1.**Azure PowerShell** - If a user signed in via Azure PowerShell's `Connect-AzAccount` command, `DefaultAzureCredential` authenticates as that user.
75
-
1.**Azure Developer CLI** - If the developer authenticated via the Azure Developer CLI `azd auth login` command, `DefaultAzureCredential` authenticates with that account.
76
-
1.**Interactive browser** - If enabled, `DefaultAzureCredential` interactively authenticates a user via the default browser. This credential type is disabled by default.
62
+
`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.
120
106
121
-
#### Specify a user-assigned managed identity for`DefaultAzureCredential`
107
+
#### Specify a user-assigned managed identity with`DefaultAzureCredential`
122
108
123
109
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:
124
110
@@ -130,20 +116,7 @@ Alternatively, set the environment variable `AZURE_CLIENT_ID` to the identity's
130
116
131
117
### Define a custom authentication flow with `ChainedTokenCredential`
132
118
133
-
`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.
134
-
135
-
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.
136
-
137
-
```python
138
-
from azure.eventhub import EventHubProducerClient
139
-
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].
147
120
148
121
### Async credentials
149
122
@@ -395,6 +368,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
0 commit comments