Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Authenticate to Azure services with various credential types.
.claude/skills/azure-identity-ts/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-08 | ✗→✓ | ▲ Improved | — | — |
| case-20 | ✓→✓ | = Same ✓ | — | — |
| case-06 | ✗→✗ | = Same ✗ | — | — |
| case-19 | ✗→✗ | = Same ✗ | — | — |
Authenticate to Azure services with various credential types.
bashnpm install @azure/identity
bashAZURE_TENANT_ID=<tenant-id> AZURE_CLIENT_ID=<client-id> AZURE_CLIENT_SECRET=<client-secret>
bashAZURE_TENANT_ID=<tenant-id> AZURE_CLIENT_ID=<client-id> AZURE_CLIENT_CERTIFICATE_PATH=/path/to/cert.pem AZURE_CLIENT_CERTIFICATE_PASSWORD=<optional-password>
bashAZURE_TENANT_ID=<tenant-id> AZURE_CLIENT_ID=<client-id> AZURE_FEDERATED_TOKEN_FILE=/var/run/secrets/tokens/azure-identity
typescriptimport { DefaultAzureCredential } from "@azure/identity"; const credential = new DefaultAzureCredential(); // Use with any Azure SDK client import { BlobServiceClient } from "@azure/storage-blob"; const blobClient = new BlobServiceClient( "https://<account>.blob.core.windows.net", credential );
Credential Chain Order:
typescriptimport { ManagedIdentityCredential } from "@azure/identity"; const credential = new ManagedIdentityCredential();
typescriptconst credential = new ManagedIdentityCredential({ clientId: "<user-assigned-client-id>" });
typescriptconst credential = new ManagedIdentityCredential({ resourceId: "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<name>" });
typescriptimport { ClientSecretCredential } from "@azure/identity"; const credential = new ClientSecretCredential( "<tenant-id>", "<client-id>", "<client-secret>" );
typescriptimport { ClientCertificateCredential } from "@azure/identity"; const credential = new ClientCertificateCredential( "<tenant-id>", "<client-id>", { certificatePath: "/path/to/cert.pem" } ); // With password const credentialWithPwd = new ClientCertificateCredential( "<tenant-id>", "<client-id>", { certificatePath: "/path/to/cert.pem", certificatePassword: "<password>" } );
typescriptimport { InteractiveBrowserCredential } from "@azure/identity"; const credential = new InteractiveBrowserCredential({ clientId: "<client-id>", tenantId: "<tenant-id>", loginHint: "user@example.com" });
typescriptimport { DeviceCodeCredential } from "@azure/identity"; const credential = new DeviceCodeCredential({ clientId: "<client-id>", tenantId: "<tenant-id>", userPromptCallback: (info) => { console.log(info.message); // "To sign in, use a web browser to open..." } });
typescriptimport { ChainedTokenCredential, ManagedIdentityCredential, AzureCliCredential } from "@azure/identity"; // Try managed identity first, fall back to CLI const credential = new ChainedTokenCredential( new ManagedIdentityCredential(), new AzureCliCredential() );
typescriptimport { AzureCliCredential } from "@azure/identity"; const credential = new AzureCliCredential(); // Uses: az login
typescriptimport { AzureDeveloperCliCredential } from "@azure/identity"; const credential = new AzureDeveloperCliCredential(); // Uses: azd auth login
typescriptimport { AzurePowerShellCredential } from "@azure/identity"; const credential = new AzurePowerShellCredential(); // Uses: Connect-AzAccount
typescriptimport { ClientSecretCredential, AzureAuthorityHosts } from "@azure/identity"; // Azure Government const credential = new ClientSecretCredential( "<tenant>", "<client>", "<secret>", { authorityHost: AzureAuthorityHosts.AzureGovernment } ); // Azure China const credentialChina = new ClientSecretCredential( "<tenant>", "<client>", "<secret>", { authorityHost: AzureAuthorityHosts.AzureChina } );
typescriptimport { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity"; const credential = new DefaultAzureCredential(); // Create a function that returns tokens const getAccessToken = getBearerTokenProvider( credential, "https://cognitiveservices.azure.com/.default" ); // Use with APIs that need bearer tokens const token = await getAccessToken();
typescriptimport type { TokenCredential, AccessToken, GetTokenOptions } from "@azure/core-auth"; import { DefaultAzureCredential, DefaultAzureCredentialOptions, ManagedIdentityCredential, ClientSecretCredential, ClientCertificateCredential, InteractiveBrowserCredential, ChainedTokenCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential, DeviceCodeCredential, AzureAuthorityHosts } from "@azure/identity";
typescriptimport type { TokenCredential, AccessToken, GetTokenOptions } from "@azure/core-auth"; class CustomCredential implements TokenCredential { async getToken( scopes: string | string[], options?: GetTokenOptions ): Promise<AccessToken | null> { // Custom token acquisition logic return { token: "<access-token>", expiresOnTimestamp: Date.now() + 3600000 }; } }
typescriptimport { setLogLevel, AzureLogger } from "@azure/logger"; setLogLevel("verbose"); // Custom log handler AzureLogger.log = (...args) => { console.log("[Azure]", ...args); };
This skill is applicable to execute the workflow or actions described in the overview.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 23 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.