Skip to content

Commit 64ef941

Browse files
authored
Drive traffic to credential chains Learn doc (#42204)
* Drive traffic to credential chains Learn doc * Switch to aka.ms links * Update API docs * Delete mermaid folder
1 parent 79acfdb commit 64ef941

File tree

8 files changed

+24
-122
lines changed

8 files changed

+24
-122
lines changed

sdk/identity/azure-identity/README.md

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,7 @@ See [Credential classes](#credential-classes) for a complete list of available c
8181

8282
### DefaultAzureCredential
8383

84-
`DefaultAzureCredential` is appropriate for most scenarios where the application is intended to ultimately be run in Azure. This is because `DefaultAzureCredential` combines credentials commonly used to authenticate when deployed, with credentials used to authenticate in a development environment.
85-
86-
> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
87-
88-
`DefaultAzureCredential` attempts to authenticate via the following mechanisms in order:
89-
90-
![DefaultAzureCredential authentication flow](images/mermaidjs/DefaultAzureCredentialAuthFlow.svg)
91-
92-
1. **Environment** - `DefaultAzureCredential` reads account information specified via [environment variables](#environment-variables) and uses it to authenticate.
93-
2. **Workload Identity** - If the app is deployed on Kubernetes with environment variables set by the workload identity webhook, `DefaultAzureCredential` authenticates the configured identity.
94-
3. **Managed Identity** - If the app is deployed to an Azure host with Managed Identity enabled, `DefaultAzureCredential` authenticates with that account.
95-
4. **Azure Developer CLI** - If the developer authenticated an account via the Azure Developer CLI `azd auth login` command, `DefaultAzureCredential` authenticates with that account.
96-
5. **IntelliJ** - If the developer authenticated via Azure Toolkit for IntelliJ, `DefaultAzureCredential` authenticates with that account.
97-
6. **Azure CLI** - If the developer authenticated an account via the Azure CLI `az login` command, `DefaultAzureCredential` authenticates with that account.
98-
7. **Azure PowerShell** - If the developer authenticated an account via the Azure PowerShell `Connect-AzAccount` command, `DefaultAzureCredential` authenticates with that account.
84+
`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].
9985

10086
#### Continuation policy
10187

@@ -131,8 +117,6 @@ public void createDefaultAzureCredential() {
131117
}
132118
```
133119

134-
For more information on configuring `DefaultAzureCredential` for your workstation or Azure, see [Configure DefaultAzureCredential](https://learn.microsoft.com/azure/developer/java/sdk/identity-azure-hosted-auth#default-azure-credential).
135-
136120
### Authenticate a user-assigned managed identity with `DefaultAzureCredential`
137121

138122
To authenticate using user-assigned managed identity, ensure that configuration instructions for your supported Azure resource [here](#managed-identity-support) have been successfully completed.
@@ -271,30 +255,7 @@ public void createManagedIdentityCredential() {
271255

272256
### Define a custom authentication flow with `ChainedTokenCredential`
273257

274-
While `DefaultAzureCredential` is generally the quickest way to get started developing apps for Azure, more advanced users may want to customize the credentials considered when authenticating. `ChainedTokenCredential` enables users to combine multiple credential instances to define a customized chain of credentials. This example demonstrates creating a `ChainedTokenCredential`, which will:
275-
276-
- Attempt to authenticate using managed identity.
277-
- Fall back to authenticating via the Azure CLI if managed identity is unavailable in the current environment.
278-
279-
```java
280-
// Authenticate using managed identity if it's available; otherwise use the Azure CLI to authenticate.
281-
282-
ManagedIdentityCredential managedIdentityCredential = new ManagedIdentityCredentialBuilder()
283-
.build();
284-
AzureCliCredential cliCredential = new AzureCliCredentialBuilder()
285-
.build();
286-
287-
ChainedTokenCredential credential = new ChainedTokenCredentialBuilder()
288-
.addLast(managedIdentityCredential)
289-
.addLast(cliCredential)
290-
.build();
291-
292-
// Azure SDK client builders accept the credential as a parameter
293-
SecretClient client = new SecretClientBuilder()
294-
.vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net")
295-
.credential(credential)
296-
.buildClient();
297-
```
258+
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].
298259

299260
## Sovereign cloud configuration
300261

@@ -491,6 +452,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
491452
[cred_wic]: https://learn.microsoft.com/java/api/com.azure.identity.workloadidentitycredential?view=azure-java-stable
492453
[cred_wic_example]: https://learn.microsoft.com/azure/aks/workload-identity-overview?tabs=java#azure-identity-client-libraries
493454
[cred_wic_ref]: https://learn.microsoft.com/azure/aks/workload-identity-overview
455+
[ctc_overview]: https://aka.ms/azsdk/java/identity/credential-chains#chainedtokencredential-overview
456+
[dac_overview]: https://aka.ms/azsdk/java/identity/credential-chains#defaultazurecredential-overview
494457
[entraid_doc]: https://learn.microsoft.com/entra/identity/
495458
[javadoc]: https://learn.microsoft.com/java/api/com.azure.identity?view=azure-java-stable
496459
[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable

sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)