auth

A command for diagnosing Azure sign-in and credential problems. Azure is Microsoft's cloud platform, and the guide covers user, device-code, service-principal, and managed-identity sign-in.

In plain words
What is it for?
Use it to check the current Azure account, start an interactive or device-code login, sign in with a service principal, or use a managed identity.
Why use it?
It explains why Azure commands fail and which type of login fits interactive use, remote machines, automation, or Azure-hosted services.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/charris-msft/azure-plugin/auth
Clone the repo
git clone --depth 1 https://github.com/charris-msft/azure-plugin
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 907 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.00907
Opus 5 $0.00005 $0.00453
Sonnet 5 $0.00002 $0.00181
Haiku 4.5 $0.00001 $0.00091

Measured yesterday against content hash 7d67cd6562d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

auth scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/auth.md · 194 lines

How it starts

The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Azure Authentication Help Command

Diagnose and resolve Azure authentication issues.

Diagnostic Steps

1. Check Current Authentication Status

az account show 2>&1

Analyze the output:

  • If successful: Show current account and subscription
  • If "Please run 'az login'": User needs to authenticate
  • If error: Diagnose specific issue

2. Common Authentication Scenarios

Interactive Login (Browser)

For users with browser access:

az login
Device Code Login (No Browser)

For headless or remote environments:

az login --use-device-code

Instruct user to:

  1. Open https://microsoft.com/devicelogin
  2. Enter the displayed code
  3. Complete authentication in browser
Service Principal Login

For automated/CI scenarios:

az login --service-principal \
  --username <app-id> \
  --password <client-secret> \
  --tenant <tenant-id>

Required information:

  • Application (client) ID
  • Client secret or certificate
  • Tenant ID
Managed Identity Login

For Azure-hosted environments (VMs, App Service, etc.):

az login --identity

For user-assigned managed identity:

az login --identity --username <managed-identity-client-id>

3. Token Management

Check Token Expiration
az account get-access-token --query "expiresOn" -o tsv

If token is expired or expiring soon:

az account get-access-token --resource https://management.azure.com/
Clear Cached Credentials

If experiencing stale credential issues:

az account clear
az login

4. Subscription Management

List All Subscriptions
az account list --output table
Switch Subscription
az account set --subscription "<name-or-id>"
Verify Current Subscription
az account show --query "{Name:name, ID:id, State:state}" -o table

Common Issues and Solutions

Issue: "AADSTS50076" - MFA Required

Cause: Multi-factor authentication is required but not completed.

Read the full file on GitHub · 194 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 194 lines · 10 tokens per session scan A 7d67cd6562d0

Subscribe to this mod's changes

auth is a command published in the GitHub repository charris-msft/azure-plugin (2 stars, last pushed 7mo ago), licensed MIT. It adds 10 tokens to every session and 907 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.