Azure / Azure/azure-powershell

[Feature]: Give adequate response for Restore-AzApiManagement errors (compared to CLI)

Open
#25,072 3 comments 0 reactions 0 assignees View on GitHub
act-observability-squad API Management customer-reported feature-request Service Attention
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.