Azure / Azure/azure-powershell

[Feature]: Optionally run `Backup-AzApiManagement` without waiting

Open
#24,998 1 comment 2 reactions 0 assignees View on GitHub
customer-reported feature-request needs-triage
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description of the new feature

`Backup-AzApiManagement` can in my experience take 30 minutes or more per APIM instance. This is using managed identity like my example from comment .

It would be great if there were a switch to run this command async, like `-NoWait`, `-AsJob` or something like that. For now I'll `Start-ThreadJob`, wait some time and check job state, before assuming the backup will succeed and then exit the script. Else this Automation Account runbook job will run for hours ($$ and not supported per ), were all it does is waiting for `Backup-AzApiManagement` to finish.

API doc, seems it supports async / skip wait for it to finish? Ref HTTP return code 202 for `Accepted: Location header contains the URL where the status of the long running operation can be checked.`:

*

### Proposed implementation details (optional)

```powershell
# Start backup, don't wait for it to finish
$BackupJob = Backup-AzApiManagement @SplatRequiredParameters -NoWait

<#
API returns 202 with URL to check status. Status can then be checked with:
#>

# Get current status of the backup job
Get-AzApiBackupStatus -BackupJob $BackupJob
```

Contributor guide

Open the contributing guide

Research direction

Start with the Backup-AzApiManagement cmdlet and the linked API Management backup REST documentation, focusing on the 202 response and its Location header. Define how the proposed no-wait result can be checked through Get-AzApiBackupStatus, and consider the command's completion behavior as the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, powershell
Domain
api, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.