Skip to content

Commit 685724e

Browse files
authored
Merge pull request #2614 from msmbaldwin/mhsm-quickstarts-includes
Add Managed HSM SDK quickstarts and refactor includes
2 parents f889b15 + 9937eac commit 685724e

23 files changed

Lines changed: 557 additions & 513 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.topic: include
6+
ms.date: 03/24/2026
7+
# Include: Azure subscription prerequisite sentence
8+
---
9+
10+
You need an Azure subscription. If you don't have one, create a [free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.topic: include
6+
ms.date: 03/24/2026
7+
# Include: Azure subscription prerequisite sentence
8+
---
9+
10+
You need an Azure subscription. If you don't have one, create a [free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: Managed HSM billing warning
9+
---
10+
11+
> [!WARNING]
12+
> Managed HSM instances are always in use. If you enable purge protection by using the `--enable-purge-protection` flag, you pay for the entire retention period.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/24/2026
8+
# Include: SDK quickstart next steps
9+
---
10+
11+
- Learn about [Secure access to your managed HSMs](/azure/key-vault/managed-hsm/how-to-secure-access)
12+
- Configure [automated key rotation](/azure/key-vault/managed-hsm/key-rotation)
13+
- Review [Managed HSM best practices](/azure/key-vault/managed-hsm/secure-managed-hsm)
14+
- Learn about [Managed HSM local RBAC built-in roles](/azure/key-vault/managed-hsm/built-in-roles)

articles/key-vault/includes/managed-hsm/sdk-prereqs.md renamed to articles/key-vault/includes/managed-hsm/sdk-prerequisites.md

File renamed without changes.

articles/key-vault/includes/managed-hsm/security-domain-prereqs.md renamed to articles/key-vault/includes/managed-hsm/security-domain-prerequisites.md

File renamed without changes.

articles/key-vault/managed-hsm/backup-restore.md

Lines changed: 44 additions & 44 deletions
Large diffs are not rendered by default.

articles/key-vault/managed-hsm/configure-network-security.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ Here's how to configure Managed HSM firewalls by using the Azure CLI:
3939
1. Use the [az keyvault update-hsm](/cli/azure/keyvault#az-keyvault-update-hsm) command to set the default action to Deny before creating a firewall.
4040

4141
```azurecli
42-
az keyvault update-hsm --resource-group "myresourcegroup" --hsm-name "mymanagedhsm" --default-action Deny
42+
az keyvault update-hsm --resource-group "ContosoResourceGroup" --hsm-name "ContosoMHSM" --default-action Deny
4343
```
4444

4545
1. Use the [az keyvault network-rule add](/cli/azure/keyvault/network-rule#az-keyvault-network-rule-add) command to add an IP address range to allow traffic.
4646

4747
```azurecli
48-
az keyvault network-rule add --resource-group "myresourcegroup" --hsm-name "mymanagedhsm" --ip-address "191.10.18.0/24"
48+
az keyvault network-rule add --resource-group "ContosoResourceGroup" --hsm-name "ContosoMHSM" --ip-address "191.10.18.0/24"
4949
```
5050

51-
1. If this key vault should be accessible by any trusted services, use the [az keyvault update](/cli/azure/keyvault#az-keyvault-update) command to set bypass to AzureServices.
51+
1. If any trusted services need access to this key vault, use the [az keyvault update](/cli/azure/keyvault#az-keyvault-update) command to set bypass to AzureServices.
5252

5353
```azurecli
54-
az keyvault update --resource-group "myresourcegroup" --hsm-name "mymanagedhsm" --bypass AzureServices
54+
az keyvault update --resource-group "ContosoResourceGroup" --hsm-name "ContosoMHSM" --bypass AzureServices
5555
```
5656

5757
# [Azure PowerShell](#tab/azure-powershell)
@@ -62,15 +62,15 @@ Here's how to configure Managed HSM firewalls by using PowerShell:
6262
1. Use the [Update-AzKeyVaultManagedHsmNetworkRuleSet](/powershell/module/az.keyvault/update-azkeyvaultmanagedhsmnetworkruleset) cmdlet to set default action to Deny and add an IP address range to allow traffic.
6363

6464
```powershell
65-
Update-AzKeyVaultManagedHsmNetworkRuleSet -Name "mymanagedhsm" -ResourceGroupName "myresourcegroup" -DefaultAction Deny -IpAddressRange @('16.17.18.0/24') -PassThru
65+
Update-AzKeyVaultManagedHsmNetworkRuleSet -Name "ContosoMHSM" -ResourceGroupName "ContosoResourceGroup" -DefaultAction Deny -IpAddressRange @('16.17.18.0/24') -PassThru
6666
```
6767

6868
Include `-ReplaceAllRules` to overwrite IP Lists. Otherwise, the command merges the newly included rules.
6969

70-
1. If this managed HSM should be accessible by any trusted services, use the [Update-AzKeyVaultManagedHsmNetworkRuleSet](/powershell/module/az.keyvault/update-azkeyvaultmanagedhsmnetworkruleset) cmdlet to set bypass to AzureServices.
70+
1. If any trusted services need access to this managed HSM, use the [Update-AzKeyVaultManagedHsmNetworkRuleSet](/powershell/module/az.keyvault/update-azkeyvaultmanagedhsmnetworkruleset) cmdlet to set bypass to AzureServices.
7171

7272
```powershell
73-
Update-AzKeyVaultManagedHsmNetworkRuleSet -Name "mymanagedhsm" -Bypass AzureServices
73+
Update-AzKeyVaultManagedHsmNetworkRuleSet -Name "ContosoMHSM" -Bypass AzureServices
7474
```
7575

7676
---

articles/key-vault/managed-hsm/how-to-secure-access.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ This tutorial provides a practical implementation example of access control for
2121
2222
## Prerequisites
2323

24-
* An Azure subscription. If you don't have one, you can sign up for a [free trial](https://azure.microsoft.com/pricing/free-trial).
24+
[!INCLUDE [Azure subscription prerequisite](../includes/azure-subscription-prerequisite.md)]
25+
26+
You also need:
27+
2528
* The Azure CLI version 2.25.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI](/cli/azure/install-azure-cli).
2629
* A managed HSM in your subscription. See [Quickstart: Provision and activate a managed HSM using Azure CLI](quick-create-cli.md) to provision and activate a managed HSM.
2730

articles/key-vault/managed-hsm/hsm-protected-keys-byok.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ ms.author: mbaldwin
1313

1414
# Import HSM-protected keys to Managed HSM (BYOK)
1515

16-
Azure Key Vault Managed HSM supports importing keys generated in your on-premises hardware security module (HSM); the keys will never leave the HSM protection boundary. This scenario often is referred to as *bring your own key (BYOK)*. Managed HSM uses the Marvell LiquidSecurity HSM adapters (FIPS 140-3 Level 3 validated) to protect your keys.
16+
Azure Key Vault Managed HSM supports importing keys generated in your on-premises hardware security module (HSM). The keys never leave the HSM protection boundary. This scenario is often referred to as *bring your own key (BYOK)*. Managed HSM uses the Marvell LiquidSecurity HSM adapters (FIPS 140-3 Level 3 validated) to protect your keys.
1717

1818
Use the information in this article to help you plan for, generate, and transfer your own HSM-protected keys to use with Managed HSM.
1919

2020
> [!NOTE]
2121
> This import method is available only for [supported HSMs](#supported-hsms).
2222
23-
For more information, and for a tutorial to get started using Managed HSM, see [What is Managed HSM?](overview.md).
23+
For more information, and for a tutorial to get started using Managed HSM, see [What is Managed HSM?](overview.md)
2424

2525
## Overview
2626

@@ -33,26 +33,27 @@ Here's an overview of the process. Specific steps to complete are described late
3333
* The target key is encrypted with a KEK, which stays encrypted until it's transferred to the Managed HSM. Only the encrypted version of your key leaves the on-premises HSM.
3434
* A KEK that's generated inside a Managed HSM isn't exportable. HSMs enforce the rule that no clear version of a KEK exists outside a Managed HSM.
3535
* The KEK must be in the same managed HSM where the target key will be imported.
36-
* When the BYOK file is uploaded to Managed HSM, a Managed HSM uses the KEK private key to decrypt the target key material and import it as an HSM key. This operation happens entirely inside the HSM. The target key always remains in the HSM protection boundary.
36+
* When you upload the BYOK file to Managed HSM, a Managed HSM uses the KEK private key to decrypt the target key material and import it as an HSM key. This operation happens entirely inside the HSM. The target key always remains in the HSM protection boundary.
3737

3838

3939
## Prerequisites
4040

41-
To use the Azure CLI commands in this article, you must have the following items:
41+
[!INCLUDE [Azure subscription prerequisite](../includes/azure-subscription-prerequisite.md)]
4242

43-
* A subscription to Microsoft Azure. If you don't have one, you can sign up for a [free trial](https://azure.microsoft.com/pricing/free-trial).
44-
* The Azure CLI version 2.12.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI]( /cli/azure/install-azure-cli).
45-
* A managed HSM the [supported HSMs list](#supported-hsms) in your subscription. See [Quickstart: Provision and activate a managed HSM using Azure CLI](quick-create-cli.md) to provision and activate a managed HSM.
43+
You also need:
44+
45+
* Azure CLI version 2.12.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI](/cli/azure/install-azure-cli).
46+
* A managed HSM in the [supported HSMs list](#supported-hsms) in your subscription. To provision and activate a managed HSM, see [Quickstart: Provision and activate a managed HSM using Azure CLI](quick-create-cli.md).
4647

4748
[!INCLUDE [cloud-shell-try-it.md](~/reusable-content/ce-skilling/azure/includes/cloud-shell-try-it.md)]
4849

49-
To sign in to Azure using the CLI, type:
50+
To sign in to Azure by using the CLI, type:
5051

5152
```azurecli
5253
az login
5354
```
5455

55-
For more information on login options via the CLI, take a look at [sign in with Azure CLI](/cli/azure/authenticate-azure-cli)
56+
For more information on authentication options through the CLI, see [sign in with Azure CLI](/cli/azure/authenticate-azure-cli).
5657

5758
## Supported HSMs
5859

@@ -86,20 +87,20 @@ For more information on login options via the CLI, take a look at [sign in with
8687

8788
### Step 1: Generate a KEK
8889

89-
A KEK is an RSA key that's generated in a Managed HSM. The KEK is used to encrypt the key you want to import (the *target* key).
90+
A KEK is an RSA key that you generate in a Managed HSM. Use the KEK to encrypt the key you want to import (the *target* key).
9091

9192
The KEK must be:
92-
- An RSA-HSM key (2,048-bit; 3,072-bit; or 4,096-bit)
93-
- Generated in the same managed HSM where you intend to import the target key
93+
- An RSA-HSM key (2,048-bit, 3,072-bit, or 4,096-bit)
94+
- Generated in the same Managed HSM where you intend to import the target key
9495
- Created with allowed key operations set to `import`
9596

9697
> [!NOTE]
97-
> The KEK must have 'import' as the only allowed key operation. 'import' is mutually exclusive with all other key operations.
98+
> The KEK must have `import` as the only allowed key operation. `import` is mutually exclusive with all other key operations.
9899
99100
Use the [az keyvault key create](/cli/azure/keyvault/key#az-keyvault-key-create) command to create a KEK that has key operations set to `import`. Record the key identifier (`kid`) that's returned from the following command. (You'll use the `kid` value in [Step 3](#step-3-generate-and-prepare-your-key-for-transfer).)
100101

101102
```azurecli-interactive
102-
az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --hsm-name ContosoKeyVaultHSM
103+
az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --hsm-name ContosoMHSM
103104
```
104105
---
105106

@@ -109,20 +110,20 @@ az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import
109110
Use [az keyvault key download](/cli/azure/keyvault/key#az-keyvault-key-download) to download the KEK public key to a .pem file. The target key you import is encrypted by using the KEK public key.
110111

111112
```azurecli-interactive
112-
az keyvault key download --name KEKforBYOK --hsm-name ContosoKeyVaultHSM --file KEKforBYOK.publickey.pem
113+
az keyvault key download --name KEKforBYOK --hsm-name ContosoMHSM --file KEKforBYOK.publickey.pem
113114
```
114115
---
115116

116-
Transfer the KEKforBYOK.publickey.pem file to your offline computer. You'll need this file in the next step.
117+
Transfer the `KEKforBYOK.publickey.pem` file to your offline computer. You need this file in the next step.
117118

118119
### Step 3: Generate and prepare your key for transfer
119120

120-
Refer to your HSM vendor's documentation to download and install the BYOK tool. Follow instructions from your HSM vendor to generate a target key, and then create a key transfer package (a BYOK file). The BYOK tool will use the `kid` from [Step 1](#step-1-generate-a-kek) and the KEKforBYOK.publickey.pem file you downloaded in [Step 2](#step-2-download-the-kek-public-key) to generate an encrypted target key in a BYOK file.
121+
To download and install the BYOK tool, see your HSM vendor's documentation. Follow the instructions from your HSM vendor to generate a target key, and then create a key transfer package (a BYOK file). The BYOK tool uses the `kid` from [Step 1](#step-1-generate-a-kek) and the `KEKforBYOK.publickey.pem` file you downloaded in [Step 2](#step-2-download-the-kek-public-key) to generate an encrypted target key in a BYOK file.
121122

122123
Transfer the BYOK file to your connected computer.
123124

124125
> [!NOTE]
125-
> Importing RSA 1,024-bit keys is not supported. Importing EC-HSM P256K keys is supported.
126+
> Importing RSA 1,024-bit keys isn't supported. Importing EC-HSM P256K keys is supported.
126127
>
127128
> **Known issue**: Importing an RSA 4K target key from Luna HSMs is only supported with firmware 7.4.0 or newer.
128129
@@ -131,7 +132,7 @@ Transfer the BYOK file to your connected computer.
131132
To complete the key import, transfer the key transfer package (a BYOK file) from your disconnected computer to the internet-connected computer. Use the [az keyvault key import](/cli/azure/keyvault/key#az-keyvault-key-import) command to upload the BYOK file to the Managed HSM.
132133

133134
```azurecli-interactive
134-
az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok
135+
az keyvault key import --hsm-name ContosoMHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok
135136
```
136137

137138
If the upload is successful, Azure CLI displays the properties of the imported key.

0 commit comments

Comments
 (0)