Azure / Azure/azure-powershell
[Feature]: Give adequate response for Restore-AzApiManagement errors (compared to CLI)
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description of the new feature
when I try restoring through Restore-AzApiManagement, I get:
```
Restore-AzApiManagement: ...restrore_from_backup.ps1:52:1
Line |
52 | Restore-AzApiManagement -ResourceGroupName $apiManagementResourceGrou …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Long running operation failed with status 'BadRequest'.
```
when I do the same through az cli, Iget:
```
(RestoreFailed) Cannot restore: current SKU is 'StandardV2', backup SKU is 'Standard'
Code: RestoreFailed
Message: Cannot restore: current SKU is 'StandardV2', backup SKU is 'Standard'
```
### Proposed implementation details (optional)
the error from PowerShell should also give the message about: `Message: Cannot restore: current SKU is 'StandardV2', backup SKU is 'Standard'`.
Contributor guide
Research direction
Start by reproducing the Restore-AzApiManagement failure from restrore_from_backup.ps1 at line 52 and compare its output with the shown az CLI response. Trace the Restore-AzApiManagement entry point to find where the long-running operation error is surfaced. Done means PowerShell exposes the service's RestoreFailed message, including the SKU mismatch details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100