Parse new azd auth error formats in AzureDeveloperCliCredential#46711
Parse new azd auth error formats in AzureDeveloperCliCredential#46711JeffreyCA merged 2 commits intoAzure:mainfrom
Conversation
pvaneck
left a comment
There was a problem hiding this comment.
LGTM overall. Looks like you just need to run black formatting locally (azpysdk black) for the Analyze check. Also, with "error" being preferred, is "suggestion" also something worth surfacing still?
Thanks, I went ahead and removed the suggestion logic since I think preferring the error makes more sense and is more helpful for understanding what exactly went wrong (exact AADSTS code and message) than the suggestion (which is usually something like re-running |
Fixes Azure/azure-dev#7859 (parent: Azure/azure-dev#7728)
Related:
Description
Starting with azd v1.23.7 (PR Azure/azure-dev#6827),
azd auth tokenchanged its stderr error format from the legacyconsoleMessageJSON to a structured{"error":"..."}JSON object. The stderr output may also include an extraneous emptyconsoleMessageline preceding the error (fixed in v1.24.0 via Azure/azure-dev#7701).This PR updates
AzureDeveloperCliCredentialerror parsing to handle all three formats:{"type":"consoleMessage","data":{"message":"..."}}{"type":"consoleMessage",...}\n{"error":"..."}(two lines){"error":"..."}(single line)Validation
In addition to unit tests, validated manually with small Python script:
Without changes (v1.23.6)
Without changes (v1.23.7+)
With changes (all versions)
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines