Azure / Azure/azure-cli

APIM gets stuck in soft-delete state

Open
#16,138 39 comments 14 reactions 1 assignee Claimed by @RupengLiu View on GitHub
act-observability-squad API Management bug Investigating Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**
A [soft-delete feature](https://docs.microsoft.com/en-us/azure/api-management/soft-delete) was recently added to API management, and is only available through the preview version of the REST API. The documentation linked above states that using the azure CLI to delete an API Management instance will result in hard delete behavior. This is true, for the `az apim delete` command.

However, deleting the entire resource group with `az group delete` puts any existing APIM resources into the soft-deleted state, so those resources cannot be redeployed (due to naming collisions) until the deleted resource expires or is purged. The purge functionality is only available through the preview version of the REST API, so it seems like the new soft-delete shouldn't affect the CLI tool.

**To Reproduce**
1. Create a new resource group
2. Create an API management instance inside that resource group
3. Use `az group delete` to delete the resource grop
4. Use the REST API to [list soft-deleted services](https://docs.microsoft.com/en-us/rest/api/apimanagement/2020-06-01-preview/deletedservices/listbysubscription), and notice that the API management instance is listed

**Expected behavior**
Using `az group delete` has the same affect on the api management instance as `az apim delete`

**Environment summary**
CLI version: 2.14.2 (installed with apt-get)
OS version: Windows 10 build 19042.630
Shell type: Bash on windows (WSL 1)

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.