Azure / Azure/azure-rest-api-specs
RecoveryServices Deleting Backup VM not Removing it From the Collection
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
Hi team,
Opening this issue to discuss the `delete` API of the backup protected item (e.g. Azure IaaS VM) of a backup vault in recovery service. Currently, `delete` API is not removing the entry. Instead, it changes the property value of `protectionState` to `ProtectionStopped`.
In Terraform, a resource is usually considered as deleted when the `get` api returns `404 NotFound` result, however for this resource after the `delete`, the resource still exists. So in Terraform, there needs to be a workaround to check the value of `protectionState` to determine if the deletion succeeded (Currently there is no so the delete operation continues waiting for 404 until timeout).
Compared with Azure Key Vault, if a key is soft-deleted, the deleted key is kept in the [deleted keys list](https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-recovery?tabs=azure-portal#list-recover-or-purge-soft-deleted-secrets-keys-and-certificates) where a user can recover it, and the `get` request returns `404` for the deleted key. This sounds like a more reasonable behavior of `delete` api.
Swagger link: https://github.com/Azure/azure-rest-api-specs/blob/321ab887a62bbf2aa2c4099bb5ab4437726fd132/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/bms.json#L1297
Reference issue: https://github.com/hashicorp/terraform-provider-azurerm/issues/4276
Contributor guide
Research direction
Start with the linked recovery services Swagger definition in bms.json around line 1297, then compare the described delete behavior with the Azure Key Vault soft-delete behavior and the linked Terraform reference issue. Done means determining and documenting the intended API contract for a deleted backup protected item, including how clients should recognize successful deletion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100