Azure Identity resolve sequence
Using AzureIdentity it is important to understand how it resolve authentication sequence
From Microsoft website
- Environment - The
DefaultAzureCredential
will read account information specified via environment variables and use it to authenticate. - Workload Identity - If the application is deployed to an Azure host with Workload Identity enabled, the
DefaultAzureCredential
will authenticate with that account. - Managed Identity - If the application is deployed to an Azure host with Managed Identity enabled, the
DefaultAzureCredential
will authenticate with that account. - Visual Studio - If the developer has authenticated via Visual Studio, the
DefaultAzureCredential
will authenticate with that account. - Visual Studio Code - Currently excluded by default as SDK authentication via Visual Studio Code is broken due to issue #27263. The
VisualStudioCodeCredential
will be re-enabled in theDefaultAzureCredential
flow once a fix is in place. Issue #30525 tracks this. In the meantime Visual Studio Code users can authenticate their development environment using the Azure CLI. - Azure CLI - If the developer has authenticated an account via the Azure CLI
az login
command, theDefaultAzureCredential
will authenticate with that account. - Azure PowerShell - If the developer has authenticated an account via the Azure PowerShell
Connect-AzAccount
command, theDefaultAzureCredential
will authenticate with that account. - Azure Developer CLI - If the developer has authenticated via the Azure Developer CLI
azd auth login
command, theDefaultAzureCredential
will authenticate with that account. - Interactive browser - If enabled, the
DefaultAzureCredential
will interactively authenticate the developer via the current system's default browser. By default, this credential type is disabled.
Comments