npx skills add ...
npx skills add microsoft/skills --skill azure-identity-dotnet
Azure Identity library for .NET. Authentication library for Azure SDK clients using Microsoft Entra ID. Use for DefaultAzureCredential, managed identity, service principals, and developer credentials. Triggers: "Azure Identity", "DefaultAzureCredential", "ManagedIdentityCredential", "ClientSecretCredential", "authentication .NET", "Azure auth", "credential chain".
npx skills add microsoft/skills --skill azure-identity-dotnet
Authentication library for Azure SDK clients using Microsoft Entra ID.
The recommended credential for most scenarios. Tries multiple authentication methods in order. See DefaultAzureCredential overview for the current credential chain order and defaults.
| Category | Credential | Purpose |
|---|---|---|
| Chains | DefaultAzureCredential | Preconfigured chain for dev-to-prod |
ChainedTokenCredential | Custom credential chain | |
| Azure-Hosted | ManagedIdentityCredential | Azure managed identity |
WorkloadIdentityCredential | Kubernetes workload identity | |
EnvironmentCredential | Environment variables | |
| Service Principal | ClientSecretCredential | Client ID + secret |
ClientCertificateCredential | Client ID + certificate | |
ClientAssertionCredential | Signed client assertion | |
| User | InteractiveBrowserCredential | Browser-based auth |
DeviceCodeCredential | Device code flow | |
OnBehalfOfCredential | Delegated identity | |
| Developer | AzureCliCredential | Azure CLI |
AzurePowerShellCredential | Azure PowerShell | |
AzureDeveloperCliCredential | Azure Developer CLI | |
VisualStudioCredential | Visual Studio |
| Exception | Description |
|---|---|
AuthenticationFailedException | Base exception for authentication errors |
CredentialUnavailableException | Credential cannot authenticate in current environment |
AuthenticationRequiredException | Interactive authentication is required |
Supported Azure services:
All credential implementations are thread-safe. A single credential instance can be safely shared across multiple clients and threads.
| Package | Purpose | Install |
|---|---|---|
Azure.Identity | Authentication (this library) | dotnet add package Azure.Identity |
Microsoft.Extensions.Azure | DI integration | dotnet add package Microsoft.Extensions.Azure |
Azure.Identity.Broker | Brokered auth | dotnet add package Azure.Identity.Broker |
| Resource | URL |
|---|---|
| NuGet Package | https://www.nuget.org/packages/Azure.Identity |
| API Reference | https://learn.microsoft.com/dotnet/api/azure.identity |
| Credential Chains | https://aka.ms/azsdk/net/identity/credential-chains |
| Best Practices | https://learn.microsoft.com/dotnet/azure/sdk/authentication/best-practices |
| GitHub Source | https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity |