Skip to content

docs: update --subscription global option to document CLI profile default resolution#2203

Open
diberry wants to merge 1 commit intomicrosoft:mainfrom
diberry:diberry/docs-subscription-default-resolution
Open

docs: update --subscription global option to document CLI profile default resolution#2203
diberry wants to merge 1 commit intomicrosoft:mainfrom
diberry:diberry/docs-subscription-default-resolution

Conversation

@diberry
Copy link
Copy Markdown
Contributor

@diberry diberry commented Mar 25, 2026

Summary

Updates the --subscription global option documentation in azmcp-commands.md to reflect the default subscription resolution behavior added in #1974.

What changed

The Global Options table previously only mentioned AZURE_SUBSCRIPTION_ID as the default for --subscription. Since #1974, the resolution order is:

  1. Explicit --subscription value from the command
  2. Azure CLI profile (~/.azure/azureProfile.json, set via az account set)
  3. AZURE_SUBSCRIPTION_ID environment variable

The 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 isDefault and 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

Copy link
Copy Markdown
Member

@sandeep-sen sandeep-sen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --subscription row in the Global Options table to reflect Azure CLI profile-based default resolution.
  • Clarifies accepted --subscription input formats (subscription GUID or display name).
  • Documents the fallback order to AZURE_SUBSCRIPTION_ID when 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. |
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
| `--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. |

Copilot uses AI. Check for mistakes.
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>
@github-actions
Copy link
Copy Markdown

Thank you for your contribution @diberry! We will review the pull request and get back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants