An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
Because deleting a Managed HSM leaves it soft-deleted and still billable, purge the HSM if purge protection permits it, verify that it no longer appears among deleted HSMs, and then submit an Azure billing support request for the accidental charges.^1^
1. Purge and verify the Managed HSM
Since the resource has already been deleted, do not recreate or recover it.
- In the Azure portal, search for Managed HSM Pools.
- Select Manage deleted HSMs.
- Locate the deleted HSM and check whether it can be purged.
- If Purge is available, select it and confirm.
Purging permanently deletes the HSM. Ensure that it contains no keys or data you need.
Alternatively, use Azure Cloud Shell or Azure CLI:
# Find soft-deleted Managed HSMs
az keyvault list-deleted \
--subscription <subscription-id> \
--resource-type hsm
# Permanently purge the relevant HSM
az keyvault purge \
--subscription <subscription-id> \
--hsm-name <hsm-name> \
--location <location>
# Verify that it is no longer listed
az keyvault list-deleted \
--subscription <subscription-id> \
--resource-type hsm
The final command should return no entry for that HSM. Listing or purging a soft-deleted HSM requires the Managed HSM Contributor role.^1^
Deleting the resource group alone is insufficient: it places the Managed HSM into a soft-deleted state, where billing continues until the HSM is purged.^2^
If purge protection is enabled
If the portal or CLI rejects the purge because purge protection is enabled, it cannot be disabled or overridden—including by Microsoft. The HSM remains recoverable and continues accruing hourly charges until the configured retention period expires and it is automatically purged.^1^
Include that fact and the purge error in the billing request. Support can review the financial impact, but cannot bypass purge protection.
2. Review and capture the charge details
In the Azure portal:
- Open Cost Management + Billing.
- Select Cost Management and the affected Pay-As-You-Go subscription.
- Open Cost Analysis.
- Set the date range to cover creation through deletion or purge.
- Group or filter the results by Resource, Resource type, or Service name to isolate the Managed HSM charge.
- Save a screenshot or export the details for the support request.
Cost Analysis is the supported location for investigating new resources and unexpected cost spikes.^3^ For an individual Pay-As-You-Go subscription, the invoice can also be compared with detailed daily usage and Cost Analysis.^4^
Some recently incurred usage can still appear while billing data is processed. The important verification is that the HSM has been purged or, when purge protection applies, that its retention status is documented.
3. Request the billing adjustment
Only Azure Billing Support can review and decide a refund, credit, or goodwill adjustment; it cannot be granted through Microsoft Learn Q&A.
- In the Azure portal, open Help + support.
- Select New support request.
- Choose a billing-related issue type, such as Billing or Subscription management, and select the affected subscription.
- Describe the request as an unexpected charge caused by accidental Managed HSM provisioning.
- Include:
- HSM resource name, resource group, region, and subscription name—do not post these publicly.
- Approximate creation, deletion, and purge times in UTC.
- The amount charged and affected billing period.
- Cost Analysis screenshots or exported usage.
- Confirmation that the HSM was intended only for learning.
- Confirmation that it was deleted immediately after discovery.
- The successful purge result, or the purge-protection error and retention period.
- A specific request for a one-time goodwill billing adjustment or Azure credit.
Azure provides billing and subscription support through Help + support → New support request, with support available continuously.^5^ Approval is discretionary, so a refund or credit cannot be guaranteed.
References