Azure / Azure/azure-powershell
KeyVault secret PURGE operation giving error 'Secret is currently being deleted'
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
I am facing an issue issue in which I am using Az.KeyVault Powershell library to do KV operations.
I am deleting a secret using `Remove-AzKeyVaultSecret -VaultName $XYZ -Name $Secret`
and purging it using `Remove-AzKeyVaultSecret -VaultName $XYZ -Name $Secret -InRemovedState`
and I am getting the error:
> Secret is currently being deleted.
There is a similar discussion here for az cli: https://github.com/Azure/azure-cli/issues/12722
Is there any command that returns the result only after the DELETE operation is completed?
I understand that it is an async operation in the backend, and if the above is not possible, what is the approximate number of retries I should execute and with how much sleep time? What is the SLA? Currently, I have 20 seconds of sleep with 5 retries, and once in a while I am still getting the error.
Contributor guide
Research direction
Start by reproducing the sequence with Remove-AzKeyVaultSecret, first deleting the secret and then using -InRemovedState, and compare the behavior with the linked Azure CLI discussion. Determine whether the cmdlet can wait for deletion completion or whether the supported retry behavior and service timing need to be documented; done means the purge path has a reliable documented outcome.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100