azure-identity-dotnet

Configure Azure SDK authentication in .NET with credential chains.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-identity-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-identity-dotnet
Source: https://github.com/davidrrowley/CortexYouV3/tree/main/.agents/skills/azure-identity-dotnet
Command: npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-identity-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Centralizes and standardizes authentication for Azure SDK clients in .NET projects so developers avoid hardcoded secrets, inconsistent credential selection, and brittle environment-specific setups. It clarifies how to authenticate using service principals, managed identities, developer tools, and credential chains across development and production.

Core Features & Use Cases

  • Unified Credential Chain: Guidance for using DefaultAzureCredential and ChainedTokenCredential to cover local developer flows and cloud-hosted identities.
  • Production-Grade Credentials: Patterns for ManagedIdentityCredential, ClientSecretCredential, and ClientCertificateCredential to securely authenticate production services.
  • Integration & Best Practices: Dependency injection for ASP.NET Core, retry and logging recommendations, sovereign cloud authority host configuration, and robust error handling for authentication failures.
  • Use Case: Retrieve secrets from Azure Key Vault from a local developer machine using DefaultAzureCredential and switch to ManagedIdentityCredential when deployed to AKS or an Azure VM.

Quick Start

Use the azure-identity-dotnet skill to generate a recommended .NET credential configuration and a concise code example that authenticates a SecretClient against Azure Key Vault for your development and production environments.

Frequently Asked Questions about azure-identity-dotnet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate Azure SDK clients in .NET without hardcoding secrets?

Authenticate Azure SDK clients in .NET without hardcoded secrets by using DefaultAzureCredential and ManagedIdentityCredential. This centralizes credential selection across local development and cloud-hosted environments, preventing brittle setups and ensuring secure access to Azure services like Key Vault.

What is the best way to configure a credential chain for Azure .NET applications?

Configuring a credential chain for Azure .NET applications is best handled using DefaultAzureCredential or ChainedTokenCredential. These cover local developer CLI flows and cloud-hosted managed identities, providing standardized authentication across development and production environments.

How do I switch from developer credentials to ManagedIdentityCredential when deploying to AKS?

Switch from developer credentials to ManagedIdentityCredential during AKS deployment by using DefaultAzureCredential. It automatically selects the appropriate identity, authenticating locally via developer CLI tools and transitioning to managed identities when deployed to cloud-hosted environments.

Does azure-identity-dotnet support sovereign cloud authority hosts and retry configuration?

Yes, azure-identity-dotnet supports sovereign cloud authority hosts, retry configuration, and logging recommendations. It provides patterns for configuring environment variables, handling credential chaining, and implementing explicit error handling for robust authentication failures.

How do I retrieve secrets from Azure Key Vault using .NET authentication patterns?

Retrieve secrets from Azure Key Vault by configuring a SecretClient with .NET authentication patterns. Use DefaultAzureCredential for local development and switch to ManagedIdentityCredential or ClientSecretCredential in production to securely authenticate and access Key Vault.

Can I use dependency injection for ASP.NET Core authentication with Azure SDKs?

Yes, you can use dependency injection for ASP.NET Core authentication with Azure SDKs. The guidance provides integration patterns for configuring credentials like ClientCertificateCredential and ChainedTokenCredential, ensuring secure access to Azure services across your application lifecycle.