Security
Key Vault Managed HSM
Provides a dedicated managed pool of hardware security modules for cryptographic keys.
Naming rules
- Abbreviation
- Length
- See resource reference
- Allowed characters
- See Microsoft’s resource reference.
- Uniqueness scope
- See resource reference
Azure Verified Modules naming utility v0.3.0 · AVM naming key managed_hsm
Code examples
Adapt the examples to your environment and supply referenced resources and variables.
Terraform
Terraform documentationhcl
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
version = "~> 2.0"
}
}
}
variable "administratorObjectId" {
type = string
}
variable "location" {
type = string
}
variable "name" {
type = string
}
variable "tenantId" {
type = string
}
variable "parent_id" {
description = "Full Azure resource ID of the parent resource or resource group."
type = string
}
resource "azapi_resource" "example" {
type = "Microsoft.KeyVault/managedHSMs@2026-05-15"
name = var.name
parent_id = var.parent_id
location = var.location
body = {
sku = {
family = "B"
name = "Standard_B1"
}
properties = {
tenantId = var.tenantId
initialAdminObjectIds = [
var.administratorObjectId
]
enablePurgeProtection = true
softDeleteRetentionInDays = 90
}
}
}
Bicep
Bicep documentationbicep
param administratorObjectId string
param location string
param name string
param tenantId string
resource example 'Microsoft.KeyVault/managedHSMs@2026-05-15' = {
name: name
location: location
sku: {
family: 'B'
name: 'Standard_B1'
}
properties: {
tenantId: tenantId
initialAdminObjectIds: [
administratorObjectId
]
enablePurgeProtection: true
softDeleteRetentionInDays: 90
}
}
ARM template
ARM template documentationjson
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"administratorObjectId": {
"type": "string"
},
"location": {
"type": "string"
},
"name": {
"type": "string"
},
"tenantId": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.KeyVault/managedHSMs",
"apiVersion": "2026-05-15",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"sku": {
"family": "B",
"name": "Standard_B1"
},
"properties": {
"tenantId": "[parameters('tenantId')]",
"initialAdminObjectIds": [
"[parameters('administratorObjectId')]"
],
"enablePurgeProtection": true,
"softDeleteRetentionInDays": 90
}
}
]
}
Private endpoints
Private endpoint target Microsoft.KeyVault/managedHSMs.
Choose the group ID for the connection you need. Available groups and DNS records depend on the cloud, region, SKU, and enabled features.
Azure public cloud
- Target subresources (group IDs)
- Private DNS zones
- Public DNS zones to forward