An Azure service that provides hardware security module management.
Hello Boris D,
Thank you for reaching out to the Microsoft Q&A forum.
When investigated it looks like you’ve done everything correctly by deleting and then purging your Managed HSM – but you’re still seeing charges because of how Managed HSM soft-delete and billing work under the covers. Here’s the rundown and what you can do:
- Soft-delete retention and billing lag
- Managed HSM has soft-delete enabled by default with a 90-day retention. When you delete an HSM, the service reserves and bills the underlying hardware until that HSM is fully purged.
- Even after you run az keyvault purge, the portal’s usage and billing data can take several hours (or in rare cases up to 24 hours) to reflect the final state.
- Purge protection vs. soft-delete
- Purge protection is optional (off by default). If it were on, you couldn’t purge until the retention period ended. Since it was off, your az keyvault purge command did succeed, but the backend de-allocation still needs to finish.
- What to check next
- Run the exact CLI command to verify there are no soft-deleted HSMs left:
az keyvault list-deleted \ --subscription <your-sub-id> \ --resource-type h - You should see an empty array once the purge is fully processed.
- In the portal go to Cost Management + Billing → Cost analysis and filter by “Managed HSM” or by the resource name to see when usage stops.
- What to expect, You’ll still see charges for the hours (or days) the HSM was reserved until the purge fully completes. After that, no new HSM charges will appear in the next billing file or cost update cycle.
- If you still see new HSM charges 24 hours after your purge succeeded, you can open a support ticket to have billing take a final look.
References
- Managed HSM soft-delete overview & billing implications https://learn.microsoft.com/azure/key-vault/managed-hsm/soft-delete-overview#soft-delete-retention-period
- Managed HSM purge protection & recovery CLI docs https://learn.microsoft.com/azure/key-vault/managed-hsm/recovery#manage-keys-and-managed-hsms
- Azure Cost Management + Billing usage and invoice details https://learn.microsoft.com/azure/cost-management-billing/understand/review-individual-bill