az keyvault purge --name "{name}" hangs forever, despite key vault being successfully purged #30333
Labels
Auto-Assign
Auto assign by bot
Auto-Resolve
Auto resolve by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
KeyVault
az keyvault
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Describe the bug
We have a PowerShell script to create an Azure key vault in a disposable environment. In the beginning of the script, we are checking if a soft-deleted key vault exists that has the same name as the key vault we're trying to create — if it does, we purge it:
While every Azure CLI command in the script runs and successfully returns after a while, the
az keyvault purge
command hangs seemingly forever ("Running" is displayed on the console). The command does what it's supposed to be doing since, when checking the Azure portal, the key vault that was supposed to be purged is indeed purged as a result of running the command. It's just that the command never returns, thus allowing the script to continue.Running the command with
--debug
reveals the fact that a certain request is being made in a loop, always resulting in a response with status code 202 Accepted (see debug output below).Related command
az keyvault purge --name '{name}'
az keyvault purge --name '{name}' --location '{location}'
Errors
There are no errors.
Issue script & Debug output
While the command hangs indefinitely, the following sections are printed to the output at short intervals:
Expected behavior
The command purges the key vault it needs to purge and resumes the script execution.
Environment Summary
azure-cli 2.58.0
core 2.58.0
telemetry 1.1.0
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users<REDACTED>.azure\cliextensions'
Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Additional context
This runs on a self-hosted build agent as part of a deployment pipeline and exhibits the same behavior.
The text was updated successfully, but these errors were encountered: