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
+31-85Lines changed: 31 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,15 +83,6 @@ This behavior allows for trying all of the developer tool credentials on your ma
83
83
84
84
## Examples
85
85
86
-
### Authenticate with `DefaultAzureCredential`
87
-
88
-
This example demonstrates authenticating `SecretClient` from the [Azure.Security.KeyVault.Secrets][secrets_client_library] client library with `DefaultAzureCredential`:
### Specify a user-assigned managed identity with `DefaultAzureCredential`
96
87
97
88
Many Azure hosts allow the assignment of a user-assigned managed identity. The following examples demonstrate configuring `DefaultAzureCredential` to authenticate a user-assigned managed identity when deployed to an Azure host. The sample code uses the credential to authenticate a `BlobClient` from the [Azure.Storage.Blobs][blobs_client_library] client library. It also demonstrates how you can specify a user-assigned managed identity either by a client ID or a resource ID.
@@ -154,52 +145,6 @@ While `DefaultAzureCredential` is generally the quickest way to authenticate app
154
145
155
146
As of version 1.8.0, `ManagedIdentityCredential` supports [token caching](#token-caching).
156
147
157
-
### Examples
158
-
159
-
These examples demonstrate authenticating `SecretClient` from the [Azure.Security.KeyVault.Secrets][secrets_client_library] client library with `ManagedIdentityCredential`.
160
-
161
-
#### Authenticate with a user-assigned managed identity
162
-
163
-
To authenticate with a user-assigned managed identity, you must specify one of the following IDs for the managed identity.
By default, credentials authenticate to the Microsoft Entra endpoint for the Azure Public Cloud. To access resources in other clouds, such as Azure US Government or a private cloud, use one of the following solutions:
@@ -224,47 +169,47 @@ Not all credentials require this configuration. Credentials that authenticate th
224
169
225
170
### Credential chains
226
171
227
-
|Credential | Usage | Reference
228
-
|-|-|-
229
-
|[`DefaultAzureCredential`][ref_DefaultAzureCredential]|Provides a simplified authentication experience to quickly start developing apps run in Azure.|[DefaultAzureCredential overview][dac_overview]
230
-
|[`ChainedTokenCredential`][ref_ChainedTokenCredential]|Allows users to define custom authentication flows comprised of multiple credentials.|[ChainedTokenCredential overview][ctc_overview]
172
+
|Credential | Usage | Reference|
173
+
|-|-|-|
174
+
|[`DefaultAzureCredential`][ref_DefaultAzureCredential]|Provides a simplified authentication experience to quickly start developing apps run in Azure.|[DefaultAzureCredential overview][dac_overview]|
175
+
|[`ChainedTokenCredential`][ref_ChainedTokenCredential]|Allows users to define custom authentication flows comprised of multiple credentials.|[ChainedTokenCredential overview][ctc_overview]|
231
176
232
177
### Authenticate Azure-hosted apps
233
178
234
-
|Credential | Usage
235
-
|-|-
236
-
|[`EnvironmentCredential`][ref_EnvironmentCredential]|Authenticates a service principal or user via credential information specified in environment variables.
237
-
|[`ManagedIdentityCredential`][ref_ManagedIdentityCredential]|Authenticates the managed identity of an Azure resource.
238
-
|[`WorkloadIdentityCredential`][ref_WorkloadIdentityCredential]|Supports [Microsoft Entra Workload ID](https://learn.microsoft.com/azure/aks/workload-identity-overview) on Kubernetes.
179
+
|Credential | Usage| Reference|
180
+
|-|-|-|
181
+
|[`EnvironmentCredential`][ref_EnvironmentCredential]|Authenticates a service principal or user via credential information specified in [environment variables](#environment-variables).||
182
+
|[`ManagedIdentityCredential`][ref_ManagedIdentityCredential]|Authenticates the managed identity of an Azure resource.|[user-assigned managed identity][uami_doc]<br>[system-assigned managed identity][sami_doc]|
183
+
|[`WorkloadIdentityCredential`][ref_WorkloadIdentityCredential]|Supports [Microsoft Entra Workload ID](https://learn.microsoft.com/azure/aks/workload-identity-overview) on Kubernetes.||
239
184
240
185
### Authenticate service principals
241
186
242
-
|Credential | Usage | Reference
243
-
|-|-|-
244
-
|[`AzurePipelinesCredential`][ref_AzurePipelinesCredential]|Supports [Microsoft Entra Workload ID](https://learn.microsoft.com/azure/devops/pipelines/release/configure-workload-identity?view=azure-devops) on Azure Pipelines.| [example](https://aka.ms/azsdk/net/identity/azurepipelinescredential/usage)
245
-
|[`ClientAssertionCredential`][ref_ClientAssertionCredential]|Authenticates a service principal using a signed client assertion.|
246
-
|[`ClientCertificateCredential`][ref_ClientCertificateCredential]|Authenticates a service principal using a certificate. | [Service principal authentication](https://learn.microsoft.com/entra/identity-platform/app-objects-and-service-principals)
247
-
|[`ClientSecretCredential`][ref_ClientSecretCredential]|Authenticates a service principal using a secret. | [Service principal authentication](https://learn.microsoft.com/entra/identity-platform/app-objects-and-service-principals)
187
+
|Credential | Usage | Reference|
188
+
|-|-|-|
189
+
|[`AzurePipelinesCredential`][ref_AzurePipelinesCredential]|Supports [Microsoft Entra Workload ID](https://learn.microsoft.com/azure/devops/pipelines/release/configure-workload-identity?view=azure-devops) on Azure Pipelines.|[example](https://aka.ms/azsdk/net/identity/azurepipelinescredential/usage)|
190
+
|[`ClientAssertionCredential`][ref_ClientAssertionCredential]|Authenticates a service principal using a signed client assertion.||
191
+
|[`ClientCertificateCredential`][ref_ClientCertificateCredential]|Authenticates a service principal using a certificate. |[Service principal authentication](https://learn.microsoft.com/entra/identity-platform/app-objects-and-service-principals)|
192
+
|[`ClientSecretCredential`][ref_ClientSecretCredential]|Authenticates a service principal using a secret. |[Service principal authentication](https://learn.microsoft.com/entra/identity-platform/app-objects-and-service-principals)|
248
193
249
194
### Authenticate users
250
195
251
-
|Credential | Usage | Reference
252
-
|-|-|-
253
-
|[`AuthorizationCodeCredential`][ref_AuthorizationCodeCredential]|Authenticates a user with a previously obtained authorization code. | [OAuth2 authentication code](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-auth-code-flow)
254
-
|[`DeviceCodeCredential`][ref_DeviceCodeCredential]|Interactively authenticates a user on devices with limited UI. | [Device code authentication](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-device-code)
255
-
|[`InteractiveBrowserCredential`][ref_InteractiveBrowserCredential]|Interactively authenticates a user with the default system browser. | [OAuth2 authentication code](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-auth-code-flow)
256
-
|[`OnBehalfOfCredential`][ref_OnBehalfOfCredential]|Propagates the delegated user identity and permissions through the request chain. | [On-behalf-of authentication](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow)
257
-
|[`UsernamePasswordCredential`][ref_UsernamePasswordCredential]|Authenticates a user with a username and password. | [Username + password authentication](https://learn.microsoft.com/entra/identity-platform/v2-oauth-ropc)
196
+
|Credential | Usage | Reference|
197
+
|-|-|-|
198
+
|[`AuthorizationCodeCredential`][ref_AuthorizationCodeCredential]|Authenticates a user with a previously obtained authorization code. |[OAuth2 authentication code](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-auth-code-flow)|
199
+
|[`DeviceCodeCredential`][ref_DeviceCodeCredential]|Interactively authenticates a user on devices with limited UI. |[Device code authentication](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-device-code)|
200
+
|[`InteractiveBrowserCredential`][ref_InteractiveBrowserCredential]|Interactively authenticates a user with the default system browser. |[OAuth2 authentication code](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-auth-code-flow)|
201
+
|[`OnBehalfOfCredential`][ref_OnBehalfOfCredential]|Propagates the delegated user identity and permissions through the request chain. |[On-behalf-of authentication](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow)|
202
+
|[`UsernamePasswordCredential`][ref_UsernamePasswordCredential]|Authenticates a user with a username and password. |[Username + password authentication](https://learn.microsoft.com/entra/identity-platform/v2-oauth-ropc)|
258
203
259
204
### Authenticate via development tools
260
205
261
-
|Credential | Usage | Reference
262
-
|-|-|-
263
-
|[`AzureCliCredential`][ref_AzureCliCredential]|Authenticates in a development environment with the Azure CLI. | [Azure CLI authentication](https://learn.microsoft.com/cli/azure/authenticate-azure-cli)
264
-
|[`AzureDeveloperCliCredential`][ref_AzureDeveloperCliCredential]|Authenticates in a development environment with the Azure Developer CLI. | [Azure Developer CLI Reference](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference)
265
-
|[`AzurePowerShellCredential`][ref_AzurePowerShellCredential]|Authenticates in a development environment with the Azure PowerShell. | [Azure PowerShell authentication](https://learn.microsoft.com/powershell/azure/authenticate-azureps)
266
-
|[`VisualStudioCredential`][ref_VisualStudioCredential]|Authenticates in a development environment with Visual Studio. | [Visual Studio configuration](https://learn.microsoft.com/dotnet/azure/configure-visual-studio)
267
-
|[`VisualStudioCodeCredential`][ref_VisualStudioCodeCredential]|Authenticates as the user signed in to the Visual Studio Code Azure Account extension. | [VS Code Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account)
206
+
|Credential | Usage | Reference|
207
+
|-|-|-|
208
+
|[`AzureCliCredential`][ref_AzureCliCredential]|Authenticates in a development environment with the Azure CLI. |[Azure CLI authentication](https://learn.microsoft.com/cli/azure/authenticate-azure-cli)|
209
+
|[`AzureDeveloperCliCredential`][ref_AzureDeveloperCliCredential]|Authenticates in a development environment with the Azure Developer CLI. |[Azure Developer CLI Reference](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference)|
210
+
|[`AzurePowerShellCredential`][ref_AzurePowerShellCredential]|Authenticates in a development environment with the Azure PowerShell. |[Azure PowerShell authentication](https://learn.microsoft.com/powershell/azure/authenticate-azureps)|
211
+
|[`VisualStudioCredential`][ref_VisualStudioCredential]|Authenticates in a development environment with Visual Studio. |[Visual Studio configuration](https://learn.microsoft.com/dotnet/azure/configure-visual-studio)|
212
+
|[`VisualStudioCodeCredential`][ref_VisualStudioCodeCredential]|Authenticates as the user signed in to the Visual Studio Code Azure Account extension. |[VS Code Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account)|
268
213
269
214
> __Note:__ All credential implementations in the Azure Identity library are threadsafe, and a single credential instance can be used by multiple service clients.
270
215
@@ -403,7 +348,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
Copy file name to clipboardExpand all lines: sdk/identity/Azure.Identity/src/Credentials/ManagedIdentityCredential.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@ namespace Azure.Identity
14
14
{
15
15
/// <summary>
16
16
/// Attempts authentication using a managed identity that has been assigned to the deployment environment. This authentication type works for all Azure-hosted
17
-
/// environments that support managed identity. More information about configuring managed identities can be found at
17
+
/// environments that support managed identity. For end-to-end guidance, see <see href="https://learn.microsoft.com/dotnet/azure/sdk/authentication/user-assigned-managed-identity">user-assigned managed identity</see>
18
+
/// or <see href="https://learn.microsoft.com/dotnet/azure/sdk/authentication/system-assigned-managed-identity">system-assigned managed identity</see>.
0 commit comments