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: docs/azure/sdk/authentication/credential-chains.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Credential chains in the Azure Identity library for .NET'
3
3
description: 'This article describes the DefaultAzureCredential and ChainedTokenCredential classes in the Azure Identity library.'
4
4
ms.topic: conceptual
5
-
ms.date: 02/13/2025
5
+
ms.date: 05/30/2025
6
6
---
7
7
8
8
# Credential chains in the Azure Identity library for .NET
@@ -70,7 +70,11 @@ In its simplest form, you can use the parameterless version of `DefaultAzureCred
70
70
71
71
### How to customize DefaultAzureCredential
72
72
73
-
To remove a credential from `DefaultAzureCredential`, use the corresponding `Exclude`-prefixed property in [DefaultAzureCredentialOptions](/dotnet/api/azure.identity.defaultazurecredentialoptions?view=azure-dotnet&preserve-view=true#properties). For example:
73
+
The following sections describe strategies for omitting credentials from the chain.
74
+
75
+
#### Exclude an individual credential
76
+
77
+
To exclude an individual credential from `DefaultAzureCredential`, use the corresponding `Exclude`-prefixed property in [DefaultAzureCredentialOptions](/dotnet/api/azure.identity.defaultazurecredentialoptions?view=azure-dotnet&preserve-view=true#properties). For example:
@@ -93,6 +97,19 @@ As more `Exclude`-prefixed properties are set to `true` (credential exclusions a
93
97
94
98
---
95
99
100
+
#### Exclude a credential type category
101
+
102
+
To exclude all `Developer tool` or `Deployed service` credentials, set environment variable `AZURE_TOKEN_CREDENTIALS` to `prod` or `dev`, respectively. When a value of `prod` is used, the underlying credential chain looks as follows:
103
+
104
+
:::image type="content" source="../media/mermaidjs/DefaultAzureCredentialEnvVarProd.svg" alt-text="DefaultAzureCredential with AZURE_TOKEN_CREDENTIALS set to 'prod'":::
105
+
106
+
When a value of `dev` is used, the chain looks as follows:
107
+
108
+
:::image type="content" source="../media/mermaidjs/DefaultAzureCredentialEnvVarDev.svg" alt-text="DefaultAzureCredential with AZURE_TOKEN_CREDENTIALS set to 'dev'":::
109
+
110
+
> [!IMPORTANT]
111
+
> The `AZURE_TOKEN_CREDENTIALS` environment variable is supported in `Azure.Identity` package versions 1.14.0 and later.
112
+
96
113
## ChainedTokenCredential overview
97
114
98
115
[ChainedTokenCredential](/dotnet/api/azure.identity.chainedtokencredential?view=azure-dotnet&preserve-view=true) is an empty chain to which you add credentials to suit your app's needs. For example:
0 commit comments