[Profile] az login: Add --get-subscriptions to limit the subscriptions that are retrieved#31977
[Profile] az login: Add --get-subscriptions to limit the subscriptions that are retrieved#31977
az login: Add --get-subscriptions to limit the subscriptions that are retrieved#31977Conversation
️✔️AzureCLI-FullTest
|
|
Hi @jiasli, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| login | cmd login added parameter get_subscriptions |
|
az login enhancement |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
Requirements
Design choices
As a reference, Azure PowerShell cmdlet Connect-AzAccount -Tenant TENANT_ID -Subscription SUB_1 -SkipContextPopulation
Connect-AzAccount -Tenant TENANT_ID -Subscription SUB_2 -SkipContextPopulation
# The last subscription will be the selected as the default one
Connect-AzAccount -Tenant TENANT_ID -Subscription SUB_3 -SkipContextPopulationWith the approach proposed in this PR, this task can be done with: az login --tenant TENANT_ID --get-subscriptions SUB_1 SUB_2 SUB_3 --subscription SUB_3Parameter naming alternativesFor limiting subscriptions, the parameter name can be
For selecting subscriptions, the parameter name can be
|
Related command
az loginDescription
Resolve #31939
Partially resolve #14933
If
--tenantand--get-subscriptionsare specified, CLI calls Subscriptions - Get to retrieve information for the specified subscriptions without calling Subscriptions - List API.Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.