-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Description
When azd auth token fails, it writes JSON to stderr:
{"type":"consoleMessage","timestamp":"...","data":{"message":"\nERROR: fetching token: ..."}}Today AzureDeveloperCliCredential includes this raw JSON verbatim in error messages, producing noisy output like:
AzureDeveloperCliCredential authentication failed: {"type":"consoleMessage","timestamp":"...","data":{"message":"\nERROR: fetching token: ..."}}
We should instead parse this JSON's .data.message field to produce cleaner errors like:
AzureDeveloperCliCredential authentication failed: ERROR: fetching token: ...
Note
.data.messagemay contain leading/trailing whitespace that should be trimmed.
This also lets us remove special-case error handling (e.g., substituting another message when azd's contains "azd auth login") because the parsed messages from azd are already user-friendly.
When JSON parsing fails or .data.message isn't set or has an empty value, include the raw text as before.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Untriaged