Azure / Azure/azure-powershell

[Feature]: `Resolve-AzError`: Include CorrelationID and RequestID if returned from API

Open
#24,993 0 comments 0 reactions 0 assignees View on GitHub
Azure PS Team customer-reported feature-request Tracking
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.