Skip to content

Conversation

@StrawnSC
Copy link
Contributor

@StrawnSC StrawnSC commented Mar 3, 2022

Description

Changes the output for az login to be more human-readable / user-friendly in response to internal feedback.

  • the default output format is table instead of JSON
  • the only fields included are isDefault, name, state, and subscriptionId
  • the default subscription is sorted to the top of the table
  • includes debug text to help new users

The user can still get a json response by running az login --output json

Output before the proposed change:
Screen Shot 2022-03-03 at 4 47 02 PM

Output after proposed change:
Screen Shot 2022-03-03 at 4 41 56 PM

Testing Guide

az login

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

formatted_subs = []
# format the output for readability
for sub in all_subs:
formatted = OrderedDict()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice :)

@yonzhan yonzhan added this to the Backlog milestone Mar 4, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 4, 2022

@jiasli for awareness

@StrawnSC StrawnSC changed the title [Draft] [Profile] az login: Format output Mar 4, 2022
@jiasli
Copy link
Member

jiasli commented Mar 7, 2022

To be honest, I personally don't agree with this change:

  • Switching the default output format from json to table is such a BREAKING CHANGE that all users and scrips relying on the JSON output of az logout will fail.
  • We tend not to sort the subscription list because the order is returned by ARM and we simply keep it as-is.

For these messages:

image

We tried to implement them via a new feature called post-output hint (#16242), but that feature got suspended.

There is also another new feature called az init developed by @zhoxing-ms to let the user select the output format interactively.

Copy link
Member

@jiasli jiasli left a comment

Choose a reason for hiding this comment

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

We need (a lot) more discussion about this BREAKING CHANGE.

@StrawnSC
Copy link
Contributor Author

StrawnSC commented Mar 7, 2022

We need (a lot) more discussion about this BREAKING CHANGE.

@jiasli I definitely agree with this and apologize if this seems like an unsolicited or unneeded change. This work is all very preliminary and I opened a pull request as a means to share progress and not to try and get these changes merged without more discussion (hence the PR is a draft and marked as do-not-merge).

@panchagnula directed the work here and can offer more info on the rationale for this change. My understanding is that internal users were confused about the output of az login and wanted a better user experience for first-time users

@panchagnula
Copy link
Contributor

@jiasli / @zhoxing-ms this is just a proof of concept PR & hence left as draft. There is a lot of feedback we are receiving on az login, that we decided to test some changes out. Do we have any telemetry for the az logout usage & how many customers would be impacted? Where can we learn more about the upcoming plans/ changes to core-cli infra? ex. Azdev init (unsure about the entire interactive approach btw). Thanks!

@zhoxing-ms
Copy link
Contributor

There is also another new feature called az init developed by @zhoxing-ms to let the user select the output format interactively.

Yes, this is az init related blog: blog link
az init adjusts the same configuration file as az config set and is meant to help simplify the configuration process. It's intended to quickly set up global configurations suitable for users' current environment.
Users can execute the az extension add -n init command to install it. Or they can directly execute az init command and then complete the automatic installation through dynamic installation.

@panchagnula
Copy link
Contributor

There is also another new feature called az init developed by @zhoxing-ms to let the user select the output format interactively.

Yes, this is az init related blog: blog link az init adjusts the same configuration file as az config set and is meant to help simplify the configuration process. It's intended to quickly set up global configurations suitable for users' current environment. Users can execute the az extension add -n init command to install it. Or they can directly execute az init command and then complete the automatic installation through dynamic installation.

@zhoxing-ms thanks for sharing this blog. This is a good start. I wanted to call out though from the feedback being received that is mostly control the response object by command. i.e config will change the response type across all CLI commands, & using Set_output_format is for the command to return a subset of the object response & in a better fashion & adding some debug text on what the next steps should be. Ex, in this POC , text showing how to set the default subscription post login was added.

@StrawnSC StrawnSC closed this Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants