Thank you for your post!
Error Message:
Cmdlet Remove-AzKeyVaultManagedHsm at command pipeline position 1
Supply values for the following parameters: (Type !? for Help.)
InRemovedState:
I understand that you're trying to purge your Managed HSM using PowerShell and even when using the PowerShell command referenced in a related Q&A question, you're running into issues preventing you from purging your HSM. To hopefully help point you in the right direction or resolve your issue, I'll share my findings below.
Findings:
Based off your error message, it looks like you'll need to use the -InRemovedState parameter within your initial Remove-AzKeyVaultManagedHsm cmdlet.
Remove-AzKeyVaultManagedHsm -Name 'myhsm' -Location "eastus" -Force -PassThru -InRemovedState
- Additionally, if you're still having issues with the Remove-AzKeyVaultManagedHsm cmdlet, you can leverage Azure CLI / Bash within the Portal to purge your HSM. For more info - Managed HSMs (CLI).
To purge a soft-deleted HSM:
az keyvault purge --subscription {SUBSCRIPTION ID} --hsm-name {HSM NAME} --location {LOCATION}
- For more info - Quickstart for Azure Cloud Shell
If you're still having issues and would like to work directly with our support team to get this issue resolved, can you please email me with the info below. I'll enable a one-time free technical support request for your subscription so you can get this issue resolved.
Email: AzCommunity@microsoft.com
Subject: ATTN - James Tran
Body:
Azure Subscription ID
Link to this issue
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.