Azure Managed HSM

Last updated Jun 3, 2026 This tutorial uses Microsoft Azure’s Managed HSM ↗︎ — a FIPS 140-2 Level 3 certified implementation — to deploy a VM with the Keyless SSL daemon.


Before you start

Make sure you have:

  • Followed Microsoft's tutorial ↗︎ for provisioning and activating the managed HSM
  • Set up a VM for your key server

1. Create a VM

Create a VM where you will deploy the keyless daemon.


2. Deploy the keyless server

Follow these instructions to deploy your keyless server.


3. Set up the Azure CLI

Set up the Azure CLI (used to access the private key).

For example, if you were using macOS:

brew install azure-cli

4. Set up the Managed HSM

  1. Log in through the Azure CLI and create a resource group for the Managed HSM in one of the supported regions:

sh az login az group create --name HSMgroup --location southcentralus

Note

For a list of supported regions, see the Microsoft documentation ↗︎. 2. Create, provision, and activate ↗︎ the HSM. 3. Add your private key to the keyvault, which returns the URI you need for Step 4:

plaintext az keyvault key import --hsm-name "KeylessHSM" --name "hsm-pub-keyless" --pem-file server.key

  1. If the key server is running in an Azure VM in the same account, use Managed services for authorization:
  2. Enable managed services on the VM in the UI.
  3. Give your service user (associated with your VM) HSM sign permissions

    plaintext az keyvault role assignment create --hsm-name KeylessHSM --assignee $(az vm identity show --name "hsmtestvm" --resource-group "HSMgroup" --query principalId -o tsv) --scope / --role "Managed HSM Crypto User"

  4. In the gokeyless YAML file, add the URI from Step 2 under private_key_stores. See our README ↗︎ for an example.

5. Restart gokeyless

Once you save the config file, restart gokeyless and verify that it started successfully:

sudo systemctl restart gokeyless.service
sudo systemctl status gokeyless.service -l

Was this helpful?

YesNo

On this page

Azure Managed HSM - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ssl/keyless-ssl/hardware-security-modules/azure-managed-hsm/#page","headline":"Azure Managed HSM","description":"This tutorial uses Microsoft Azure's Managed HSM to deploy a VM with the Keyless SSL daemon. Follow these instructions to deploy your keyless server.","url":"https://developers.cloudflare.com/ssl/keyless-ssl/hardware-security-modules/azure-managed-hsm/","inLanguage":"en","image":"https://developers.cloudflare.com/ssl/keyless-ssl/hardware-security-modules/azure-managed-hsm/og.png?v=8299631a51db1c38","dateModified":"2026-06-03","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Azure"]}


description: Configure the key server to work with hardware security modules. title: Configuration image: https://developers.cloudflare.com/ssl/keyless-ssl/hardware-security-modules/configuration/og.png?v=d5a1e67f34b62428


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ssl/llms.txt
Use this file to discover all available pages before exploring further.