-
Notifications
You must be signed in to change notification settings - Fork 330
Closed
Copy link
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
Labels
Azure.IdentityThe azure_identity crateThe azure_identity crate
Type
Projects
Status
Done
Status
Done