azure-rest-api-specs icon indicating copy to clipboard operation
azure-rest-api-specs copied to clipboard

RecoveryServices Deleting Backup VM not Removing it From the Collection

Open myc2h6o opened this issue 2 years ago • 6 comments

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 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

myc2h6o avatar May 05 '22 07:05 myc2h6o

@myc2h6o Thank you for reaching out, we are looking into it.

RakeshMohanMSFT avatar Jun 01 '22 06:06 RakeshMohanMSFT

Adding Service team to look into this.

navba-MSFT avatar Oct 26 '22 04:10 navba-MSFT

Thanks for the update. The original issue in Terraform AzureRM provider has been resolved by https://github.com/hashicorp/terraform-provider-azurerm/pull/16939. Feel free to close this issue.

myc2h6o avatar Oct 26 '22 04:10 myc2h6o

@myc2h6o Thanks for the update. We will now proceed with closure of this GitHub issue. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.

navba-MSFT avatar Oct 26 '22 05:10 navba-MSFT

@navba-MSFT @myc2h6o looks like the original FR in this PR is still valid/unfixed, however - so shouldn't this remain open until it's fixed?

tombuildsstuff avatar Oct 26 '22 12:10 tombuildsstuff

@navba-MSFT could you help re-open the issue and see if service team consider the original ask a valid feature request?

myc2h6o avatar Oct 26 '22 12:10 myc2h6o