Azure / Azure/azure-powershell
[Feature]: `Resolve-AzError`: Include CorrelationID and RequestID if returned from API
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description of the new feature
`Resolve-AzError`: Include CorrelationID and RequestID if returned from whatever API was invoked.
Context: We have an automation account runbook with system assigned managed identity where `Connect-AzAccount -Identity` randomly fails, sometimes with error messages that's hard to interpret like "Operation returned an invalid status code 'Forbidden'". If we're to look deeper into what caused this issue, maybe also create a ticket to Azure support, it'd be very helpful if the error message and/or `Resolve-AzError` could output CorrelationID and RequestID if returned by the API.
### Proposed implementation details (optional)
If API returns anything, look for CorrelationID an RequestID and include it in the error message for Az cmdlets.
Contributor guide
Assessment
This issue has not been assessed yet.