Blog Post

Azure Tools Blog
6 MIN READ

Faster az login: introducing --skip-subscription-discovery and targeted --subscription

Alex-wdy's avatar
Alex-wdy
Icon for Microsoft rankMicrosoft
Jun 07, 2026

TL;DR — If you belong to many tenants, or a tenant holds hundreds or thousands of subscriptions, az login can crawl — it tries to enumerate every subscription in every tenant before it returns. Two flags now let you skip that enumeration and make login near-instant.

TL;DR — If you belong to many tenants, or a tenant holds hundreds or thousands of subscriptions, az login can crawl — it tries to enumerate every subscription in every tenant before it returns. Two flags now let you skip that enumeration and make login near-instant:

az login --tenant <TENANT_ID> --skip-subscription-discovery

az login --subscription <SUB_ID_OR_NAME>

az login --tenant <TENANT_ID> --subscription <SUB_ID_OR_NAME> --skip-subscription-discovery

Available in Azure CLI 2.86.0 and later. Both --skip-subscription-discovery (and its --skip-sub alias) ship in az CLI v2.86.0. Run az version to check, and az upgrade if you're on an older build.

Note: --skip-subscription-discovery requires --tenant. Because you're skipping the tenant/subscription enumeration, the CLI can't infer which tenant to sign in to, so you must name it explicitly. Running az login --skip-subscription-discovery on its own fails with usage error: '--skip-subscription-discovery' requires '--tenant'.

 

The problem: login enumerates every subscription in every tenant

This post is about one specific pain point: what happens when you have a large number of tenants, and tenants that each contain hundreds or thousands of subscriptions.

When you run az login, the CLI doesn't just authenticate you. After auth, it walks every tenant you can access and calls ARM to list every subscription in each one, then caches the full catalog locally. The cost of that step scales with (number of tenants) × (subscriptions per tenant) — so it's roughly invisible for a developer with one tenant and a couple of subscriptions, but it falls off a cliff at enterprise scale:

  • A user who is a member or guest of dozens of tenants pays a separate ARM round trip per tenant.
  • A single tenant with hundreds or thousands of subscriptions means one giant (often paged) enumeration just to build a list you may never look at.
  • Put both together — many tenants, each dense with subscriptions — and the enumeration dominates everything. The interactive sign-in is fast; the post-auth subscription discovery is what makes you wait.

In these high-scale tenant/subscription topologies, az login taking 30 seconds to several minutes is common — and almost all of that time is the discovery walk, not authentication. That is exactly the cost these flags remove.

Other situations (CI/CD pinned to one known subscription, conditional-access tenants, etc.) benefit too, but they're secondary. The flags exist first and foremost to rescue the many-tenants / many-subscriptions case.

 

What's new

1. --skip-subscription-discovery (alias --skip-sub)

Authenticate only. Skip the subscription enumeration entirely. No tenant fan-out, no ARM GET /subscriptions calls per tenant. This flag requires --tenant — since discovery is skipped, you must tell the CLI which tenant to authenticate against.

az login --tenant <TENANT_ID> --skip-subscription-discovery

# or the short form

az login --tenant <TENANT_ID> --skip-sub

After this, az account list will be empty until you explicitly populate it (e.g. by az login --subscription <id> later, or by running a command that targets a subscription you know).

The flag is independent of how you authenticate — interactive (the WAM account picker or browser), device code, service principal, or managed identity all work the same way. You complete your normal sign-in, just without the subscription enumeration afterward.

Best for:

  • Users who belong to many tenants, or tenants with hundreds-to-thousands of subscriptions — this is where the win is biggest, because you skip the enumeration that scales with (tenants) × (subscriptions per tenant). Pin the one subscription you need via --subscription or AZURE_SUBSCRIPTION_ID.
  • Local developers who hit az login dozens of times a day and only ever work in one subscription. (You'll still get the interactive WAM account picker — that's the auth step; only the post-auth subscription enumeration is skipped.)
  • Secondary: CI/CD with service principals or managed identities that already know the exact subscription, and cross-tenant guests who don't need the full catalog every login.

What you'll see: --skip-subscription-discovery does not suppress the interactive sign-in prompt — it only skips the post-auth tenant/subscription enumeration. On an interactive login (no cached or still-valid token), the Web Account Manager (WAM) account picker still appears so you can authenticate; the flag simply skips the catalog fetch after you've signed in.

The screenshot below is Windows, where the broker (WAM) drives sign-in. On Linux and macOS there's no WAM — the interactive step is a browser redirect (or a device code in headless/SSH environments) instead. The flag's behavior, and the performance win, are identical on every platform; only this sign-in UI differs.

 

2. Targeted --subscription <id-or-name> on az login

Sign in and set a specific subscription as the active context in one step.

az login --subscription 00000000-0000-0000-0000-000000000000

az login --subscription "Contoso Production"

The CLI authenticates and sets the subscription you named as active. But note: on its own, --subscription does not skip discovery — the CLI still enumerates every tenant and every subscription you have access to, and only then selects the one you named as active. So if you have many subscriptions, this is still slow; you've just saved yourself a follow-up az account set.

To actually skip the full fetch, combine it with --skip-subscription-discovery (see below).

3. The combo

az login --tenant <TENANT_ID> --subscription <SUB_ID> --skip-subscription-discovery

You get: authenticated session + active subscription set + zero tenant fan-out. With both flags, the CLI fetches only the subscription you named and skips the global enumeration entirely — this is the only way to get both a pinned subscription and a fast login. It's the fastest path to a working CLI for a known target.

How much faster?

Real-world impact scales with how many tenants you belong to and how many subscriptions each tenant holds — the bigger that product, the more you save. Order-of-magnitude observations from the field:

ProfileTypical az login timeWith --skip-subscription-discovery
1 tenant, 1–3 subs (typical dev)~3–5 s~2–3 s
1 tenant, hundreds–thousands of subs20–60+ s~2–3 s
Many tenants, each with hundreds+ subs (the headline case)1–several minutes~2–3 s
CI/CD with service principal, 1 known sub5–10 s~1 s

The savings come entirely from cutting the per-tenant ARM enumeration — and they grow the more tenants and subscriptions you have.

When not to use these flags

  • You genuinely don't know which subscription you need and rely on az account list / az account set after login to pick. Plain az login is still the right call.
  • You manage resources across many subscriptions in one session. Without discovery, az account list will be empty and tab-completion of subscriptions won't work. (Tip: run a one-time az account list --refresh later to populate.)
  • First-time setup on a new machine where you want to see what you have access to.

Try it now

Make sure you're on a recent az CLI:

az version

az upgrade # if needed

Then:

az login --tenant <your-tenant> --subscription <your-sub> --skip-subscription-discovery

az group list -o table

Links & references

Feedback wanted

If this changes your day-to-day login experience — especially if you live across many tenants with hundreds or thousands of subscriptions — we'd love to hear from you. Concrete before/after timings for those high-scale topologies are gold.

Updated Jun 07, 2026
Version 1.0
No CommentsBe the first to comment