Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

[partner asks] Azure CLI expired auth session error message should provide more guidance #15661

Open chenlomis opened 4 years ago

chenlomis commented 4 years ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug "While working with the Azure CLI (2.0.77) and KeyVault (on Mac) I got the following error message:

Get Token request returned http error: 400 and server response: {"error":"interaction_required","error_description":"AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator, you must refresh your multi-factor authentication to access 'AzureKeyVault'.\r\nTrace ID: 984d1791-cadb-40b8-b7cc-7ace1e0b5800\r\nCorrelation ID: b13e1013-bb05-4e99-82e1-b87a0d7d3cd0\r\nTimestamp: 2020-01-30 03:50:16Z","error_codes":[50078],"timestamp":"2020-01-30 03:50:16Z","trace_id":"984d1791-cadb-40b8-b7cc-7ace1e0b5800","correlation_id":"b13e1013-bb05-4e99-82e1-b87a0d7d3cd0","suberror":"basic_action"}

The error is clear, however it does not provide any guidance for HOW to go about refreshing your authentication via the CLI...forcing the user to hunt for the right command. "

To Reproduce See above

Expected behavior "A more delightful user experience could be provided if the error message included simple guidance for solving the problem (or even an aka link to the appropriate docs). In this case, it could be as simple as instructing the user to try running az login and try again."

Environment summary

Additional context original issue: https://azuretracking.visualstudio.com/Azure%20tracking/_workitems/edit/1001

The output seems to be a service error. although we should be able to support appending additional "recommendations" as we're extending the knack framework?

yonzhan commented 4 years ago

add to S178