Could the resource manager recover soft-deleted Key Vaults and Recovery Vaults when depoyed to same rg, location, and name?
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
Assuming you delete a key, or recovery, vault from a resource group, they go to a 'soft delete' state where they can be recovered recovered as-was for a certain time.
We have code which cleans up our development environments, but have had to introduce handling for resources which support a soft-delete state, because when we deploy the template again, against the same subscription, resource group, location, and resource name, we get an error staying the resource could not be recreated.
It would be great if, assuming the following scenarios were true, that the resource was recreated, with whatever settings were configured in the template + whichever old date.
Validation (first four are required to restore from soft-delete):
- Same Azure Subscription
- Same Resource Group
- Same Location
- Same Name
- User is able to perform the soft-delete recover operation
I imagine, while probably oversimplifying that given the above validation, the resource should be restored, and then the changes from the template is attempted to be applied - if this fails the deployment should fail, and either leave the resource as re-established (as that operation probably succeeded) - I find this behavior to be similar to how other resources are setup, where there is often minimal pre-flight checks, and most of the resources are attempted to be deployed, and may fail due to invalid properties, which still leaves the template as created.
Contributor guide
Research direction
Start by reviewing the Azure deployment behavior for soft-deleted Key Vaults and Recovery Vaults, including the required subscription, resource group, location, name, and recovery permission checks described in the issue. Determine where resource recreation is handled and identify existing tests for deployment failures; done means a matching soft-deleted vault can be recovered and then configured from the template, with failures reported appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100