diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 9f632ca70a277..fc20b82ff69c2 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -86,12 +86,12 @@ The `DefaultAzureCredential` is appropriate for most scenarios where the applica The `DefaultAzureCredential` will attempt to authenticate via the following mechanisms in order. -![DefaultAzureCredential authentication flow](https://github.com/Azure/azure-sdk-for-java/raw/main/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg) +![DefaultAzureCredential authentication flow](images/mermaidjs/DefaultAzureCredentialAuthFlow.svg) 1. **Environment** - The `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate. 1. **Managed Identity** - If the application is deployed to an Azure host with Managed Identity enabled, the `DefaultAzureCredential` will authenticate with that account. -1. **IntelliJ** - If the developer has authenticated via Azure Toolkit for IntelliJ, the `DefaultAzureCredential` will authenticate with that account. 1. **Azure Developer CLI** - If the developer has authenticated an account via the Azure Developer CLI `azd login` command, the `DefaultAzureCredential` will authenticate with that account. +1. **IntelliJ** - If the developer has authenticated via Azure Toolkit for IntelliJ, the `DefaultAzureCredential` will authenticate with that account. 1. **Azure CLI** - If the developer has authenticated an account via the Azure CLI `az login` command, the `DefaultAzureCredential` will authenticate with that account. 1. **Azure PowerShell** - If the developer has authenticated an account via the Azure PowerShell `Connect-AzAccount` command, the `DefaultAzureCredential` will authenticate with that account. @@ -328,7 +328,7 @@ Not all credentials require this configuration. Credentials that authenticate th Service principal authentication - ClientSecretCredential + ClientSecretCredential authenticates a service principal using a secret example Service principal authentication @@ -400,8 +400,7 @@ Not all credentials require this configuration. Credentials that authenticate th Authenticate in a development environment with the enabled user or service principal in Azure Developer CLI - - + Azure Developer CLI Reference AzureCliCredential @@ -430,6 +429,8 @@ Not all credentials require this configuration. Credentials that authenticate th +> __Note:__ `AzureDeveloperCliCredential` is in beta and its name may change before the stable release. + > __Note:__ All credential implementations in the Azure Identity library are threadsafe, and a single credential instance can be used to create multiple service clients. Credentials can be chained together to be tried in turn until one succeeds using the `ChainedTokenCredential`; see [chaining credentials](#define-a-custom-authentication-flow-with-the-chainedtokencredential) for details. diff --git a/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.md b/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.md index 9b2bfc7e4c782..878f9960242a0 100644 --- a/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.md +++ b/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.md @@ -2,17 +2,18 @@ %% STEPS TO GENERATE IMAGE %% ======================= %% 1. Install mermaid CLI (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md) +%% v8.14.0 is known good for our process. npm install -g @mermaid-js/mermaid-cli@8.14.0 %% 2. Run command: mmdc -i DefaultAzureCredentialAuthFlow.md -o DefaultAzureCredentialAuthFlow.svg flowchart LR; - A(Environment):::deployed ==> B(Managed Identity):::deployed ==> C(IntelliJ):::developer ==> D(Azure CLI):::developer ==> E(Azure PowerShell):::developer; + A(Environment):::deployed ==> B(Managed Identity):::deployed ==> C(Azure Developer CLI):::developer ==> D(IntelliJ):::developer ==> E(Azure CLI):::developer ==> F(Azure PowerShell):::developer; subgraph CREDENTIAL TYPES; direction LR; Deployed(Deployed service):::deployed ==> Developer(Developer):::developer; %% Hide links between boxes in the legend by setting width to 0. The integers after "linkStyle" represent link indices. - linkStyle 4 stroke-width:0px; + linkStyle 5 stroke-width:0px; end; %% Define styles for credential type boxes @@ -20,9 +21,9 @@ flowchart LR; classDef developer fill:#F5AF6F, stroke:#EB7C39; %% Add API ref links to credential type boxes - click A "https://docs.microsoft.com/java/api/com.azure.identity.environmentcredential?view=azure-java-stable" _blank; - click B "https://docs.microsoft.com/java/api/com.azure.identity.managedidentitycredential?view=azure-java-stable" _blank; - click C "https://docs.microsoft.com/java/api/com.azure.identity.intellijcredential?view=azure-java-stable" _blank; - click E "https://docs.microsoft.com/java/api/com.azure.identity.azureclicredential?view=azure-java-stable" _blank; - click F "https://docs.microsoft.com/java/api/com.azure.identity.azurepowershellcredential?view=azure-java-stable" _blank; + click A "https://learn.microsoft.com/java/api/com.azure.identity.environmentcredential?view=azure-java-stable" _blank; + click B "https://learn.microsoft.com/java/api/com.azure.identity.managedidentitycredential?view=azure-java-stable" _blank; + click D "https://learn.microsoft.com/java/api/com.azure.identity.intellijcredential?view=azure-java-stable" _blank; + click E "https://learn.microsoft.com/java/api/com.azure.identity.azureclicredential?view=azure-java-stable" _blank; + click F "https://learn.microsoft.com/java/api/com.azure.identity.azurepowershellcredential?view=azure-java-stable" _blank; ``` diff --git a/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg b/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg index 4eb5f57ec66d0..defa2c4533677 100644 --- a/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg +++ b/sdk/identity/azure-identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg @@ -1 +1 @@ -
CREDENTIAL TYPES
Developer
Deployed service
Environment
Managed Identity
IntelliJ
Azure CLI
Azure PowerShell
\ No newline at end of file +
CREDENTIAL TYPES
Developer
Deployed service
Environment
Managed Identity
Azure Developer CLI
IntelliJ
Azure CLI
Azure PowerShell
\ No newline at end of file diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java index 4f357446479cb..76ff788f43406 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java @@ -15,9 +15,9 @@ *
    *
  1. {@link EnvironmentCredential}
  2. *
  3. {@link ManagedIdentityCredential}
  4. + *
  5. {@link AzureDeveloperCliCredential}
  6. *
  7. {@link SharedTokenCacheCredential}
  8. *
  9. {@link IntelliJCredential}
  10. - *
  11. {@link AzureDeveloperCliCredential}
  12. *
  13. {@link AzureCliCredential}
  14. *
  15. {@link AzurePowerShellCredential}
  16. *
  17. Fails if none of the credentials above could be created.