Azure / Azure/azure-cli

Change required arguments for az account set command as optional

Open
#29,095 3 comments 0 reactions 1 assignee Assigned to @jiasli View on GitHub
Account act-identity-squad Auto-Assign Azure CLI Team customer-reported feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**
az account set

**Is your feature request related to a problem? Please describe.**
No, quality of life improvement for interactive sessions.

**Describe the solution you'd like**
The new interactive login experience introduced in version 2.61.0 is awesome. The table to select the subscription is convenient. Why not display the table again when running `az account set` with no arguments at all instead of erroring out saying "the following arguments are required: --subscription/-s/--name/-n`"?

**Describe alternatives you've considered**
None. Currently we'd need to run `az account list --output table` THEN copy either the Name or SubscriptionId THEN pass it into the az account set command with the proper argument. It's a bit annoying for users with 6+ subscriptions that they work with every day.

**Additional context**
Current experience:
![image](https://github.com/Azure/azure-cli/assets/12534476/5bd6c42b-fa47-4f6a-b648-f1817f0f24a9)

Requested experience:
`PS C:\> az account set

[Tenant and subscription selection]

No Subscription name Subscription ID Tenant
----- ------------------------------------ ------------------------------------ ------------

The default is marked with an *; the default tenant is '' and subscription is '' ().

Select a subscription and tenant (Type a number or Enter for no changes):
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.