docs: update --subscription global option to document CLI profile default resolution#2203
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the --subscription global option documentation to match the post-#1974 default subscription resolution behavior (Azure CLI profile first, then AZURE_SUBSCRIPTION_ID), aligning the global options table with other sections of the doc.
Changes:
- Updates the
--subscriptionrow in the Global Options table to reflect Azure CLI profile-based default resolution. - Clarifies accepted
--subscriptioninput formats (subscription GUID or display name). - Documents the fallback order to
AZURE_SUBSCRIPTION_IDwhen the Azure CLI profile default is not set.
| | Option | Required | Default | Description | | ||
| |-----------|----------|---------|-------------| | ||
| | `--subscription` | No | Environment variable `AZURE_SUBSCRIPTION_ID` | Azure subscription ID for target resources | | ||
| | `--subscription` | No | Azure CLI profile (`az account set`), then `AZURE_SUBSCRIPTION_ID` env var | Specifies the Azure subscription to use. Accepts either a subscription ID (GUID) or display name. If not specified, the default subscription is resolved from the Azure CLI profile (`~/.azure/azureProfile.json`, configured via `az account set`) or, if not set there, from the `AZURE_SUBSCRIPTION_ID` environment variable. | |
There was a problem hiding this comment.
This table row is very long and repeats similar details across the Default and Description columns, which can make the Markdown table hard to read/render (especially on narrow viewports). Consider shortening the Default column to something compact (e.g., “Azure CLI profile or AZURE_SUBSCRIPTION_ID”) and keeping the full resolution explanation only in the Description (or moving the multi-sentence explanation to a short note below the table).
| | `--subscription` | No | Azure CLI profile (`az account set`), then `AZURE_SUBSCRIPTION_ID` env var | Specifies the Azure subscription to use. Accepts either a subscription ID (GUID) or display name. If not specified, the default subscription is resolved from the Azure CLI profile (`~/.azure/azureProfile.json`, configured via `az account set`) or, if not set there, from the `AZURE_SUBSCRIPTION_ID` environment variable. | | |
| | `--subscription` | No | Azure CLI profile or `AZURE_SUBSCRIPTION_ID` | Specifies the Azure subscription to use. Accepts either a subscription ID (GUID) or display name. If not specified, the default subscription is resolved from the Azure CLI profile (`~/.azure/azureProfile.json`, configured via `az account set`) or, if not set there, from the `AZURE_SUBSCRIPTION_ID` environment variable. | |
The --subscription parameter description only mentioned AZURE_SUBSCRIPTION_ID as the fallback. Since microsoft#1974 merged, the resolution order is: 1. Explicit --subscription value 2. Azure CLI profile (~/.azure/azureProfile.json, set via 'az account set') 3. AZURE_SUBSCRIPTION_ID environment variable Update the Global Options table to reflect this and accept display names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0a7d638 to
9d90f18
Compare
|
Thank you for your contribution @diberry! We will review the pull request and get back to you soon. |
Summary
Updates the
--subscriptionglobal option documentation inazmcp-commands.mdto reflect the default subscription resolution behavior added in #1974.What changed
The Global Options table previously only mentioned
AZURE_SUBSCRIPTION_IDas the default for--subscription. Since #1974, the resolution order is:--subscriptionvalue from the command~/.azure/azureProfile.json, set viaaz account set)AZURE_SUBSCRIPTION_IDenvironment variableThe updated description also notes that both subscription ID (GUID) and display name are accepted.
Why
The subscription list tool section (lines 3454-3456) was already updated by #1974 to document
isDefaultand the CLI profile behavior. However, the Global Options table still showed the old default. This creates an inconsistency - users reading the global options would not know about CLI profile resolution.Related