Skip to content

Commit f4a4238

Browse files
authored
Update backup-restore.md
1 parent a9f6e7e commit f4a4238

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

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

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: azure-key-vault
88
ms.service: key-vault
99
ms.subservice: managed-hsm
1010
ms.topic: tutorial
11-
ms.date: 10/23/2023
11+
ms.date: 12/11/2023
1212
ms.author: mbaldwin
1313
# Customer intent: As a developer using Key Vault I want to know the best practices so I can implement them.
1414
---
@@ -25,42 +25,44 @@ Only following built-in roles have permission to perform full backup:
2525
- Managed HSM Administrator
2626
- Managed HSM Backup
2727

28-
You must provide following information to execute a full backup:
28+
There are 2 ways to execute a full backup. You must provide the following information to execute a full backup:
2929
- HSM name or URL
3030
- Storage account name
3131
- Storage account blob storage container
32-
- Storage container SAS token with permissions `crdw` (if storage account is not behind a private endpoint)
32+
- User assigned managed identity OR storage container SAS token with permissions 'crdw'
3333

34-
#### Prerequisites if the storage account is behind a private endpoint (preview):
34+
> [!NOTE]
35+
> Backing up and restoring using storage container SAS token requires your storage account to have public network access enabled. You can backup and restore your MHSM using a user assigned managed identity regardless of whether your storage account has public network access or private network access enabled, including if the storage account is behind a private endpoint.
36+
37+
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
38+
39+
#### Prerequisites if backing up and restoring using user assigned managed identity (preview):
3540

3641
1. Ensure you have the Azure CLI version 2.54.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).
3742
2. Create a user assigned managed identity.
3843
3. Create a storage account (or use an existing storage account).
39-
4. Enable Trusted service bypass on the storage account in the “Networking” tab, under “Exceptions.”
40-
41-
6. Provide ‘storage blob data contributor’ role access to the user assigned managed identity created in step#2. Do this by going to the “Access Control” tab on the portal -> Add Role Assignment. Then select “managed identity” and select the managed identity created in step#2 -> Review + Assign
42-
7. Create the Managed HSM and associate the managed identity with below command.
44+
4. If public network access is diabled on your storage account, enable trusted service bypass on the storage account in the “Networking” tab, under “Exceptions.”
45+
5. Provide ‘storage blob data contributor’ role access to the user assigned managed identity created in step#2. Do this by going to the “Access Control” tab on the portal -> Add Role Assignment. Then select “managed identity” and select the managed identity created in step#2 -> Review + Assign
46+
6. Create the Managed HSM and associate the managed identity with below command.
4347
```azurecli-interactive
4448
az keyvault create --hsm-name mhsmdemo2 –g mhsmrgname –l mhsmlocation -- retention-days 7 --administrators "initialadmin" --mi-user-assigned "/subscriptions/subid/resourcegroups/mhsmrgname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userassignedidentitynamefromstep2"
4549
```
46-
8. If you have an existing Managed HSM, associate the managed identity by updating the MHSM with the below command.
50+
If you have an existing Managed HSM, associate the managed identity by updating the MHSM with the below command.
4751
```azurecli-interactive
4852
az keyvault update-hsm --hsm-name mhsmdemo2 –g mhsmrgname --mi-user-assigned "/subscriptions/subid/resourcegroups/mhsmrgname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userassignedidentitynamefromstep2"
4953
```
5054

51-
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
52-
5355
## Full backup
5456

5557
Backup is a long running operation but will immediately return a Job ID. You can check the status of backup process using this Job ID. The backup process creates a folder inside the designated container with a following naming pattern **`mhsm-{HSM_NAME}-{YYYY}{MM}{DD}{HH}{mm}{SS}`**, where HSM_NAME is the name of managed HSM being backed up and YYYY, MM, DD, HH, MM, mm, SS are the year, month, date, hour, minutes, and seconds of date/time in UTC when the backup command was received.
5658

5759
While the backup is in progress, the HSM might not operate at full throughput as some HSM partitions will be busy performing the backup operation.
5860

59-
### Backup HSM when storage account is behind a private endpoint (preview)
61+
### Backup HSM using user assigned managed identity (preview)
6062
```azurecli-interactive
6163
az keyvault backup start --use-managed-identity true --hsm-name mhsmdemo2 -- storage-account-name mhsmdemobackup --blob-container-name mhsmdemobackupcontainer
6264
```
63-
### Backup HSM when storage account is not behind a private endpoint
65+
### Backup HSM using SAS token
6466

6567
```azurecli-interactive
6668
# time for 500 minutes later for SAS token expiry
@@ -94,20 +96,20 @@ Full restore allows you to completely restore the contents of the HSM with a pre
9496
9597
Restore is a data plane operation. The caller starting the restore operation must have permission to perform dataAction **Microsoft.KeyVault/managedHsm/restore/start/action**. The source HSM where the backup was created and the destination HSM where the restore will be performed **must** have the same Security Domain. See more [about Managed HSM Security Domain](security-domain.md).
9698

97-
You must provide the following information to execute a full restore:
99+
There are 2 ways to execute a full restore. You must provide the following information to execute a full restore:
98100
- HSM name or URL
99101
- Storage account name
100102
- Storage account blob container
101-
- Storage container SAS token with permissions `rl` (if storage account is not behind a private endpoint)
103+
- User assigned managed identity OR storage container SAS token with permissions `rl`
102104
- Storage container folder name where the source backup is stored
103105

104106
Restore is a long running operation but will immediately return a Job ID. You can check the status of the restore process using this Job ID. When the restore process is in progress, the HSM enters a restore mode and all data plane command (except check restore status) are disabled.
105107

106-
### Restore HSM when storage account is behind a private endpoint (preview)
108+
### Restore HSM using user assigned managed identity (preview)
107109
```azurecli-interactive
108110
az keyvault restore start --hsm-name mhsmdemo2 --storage-account-name mhsmdemobackup--blob-container-name mhsmdemobackupcontainer --backup-folder mhsm-backup-foldername --use-managed-identity true
109111
```
110-
### Restore HSM when storage account is not behind a private endpoint
112+
### Restore HSM using SAS token
111113

112114
```azurecli-interactive
113115
# time for 500 minutes later for SAS token expiry
@@ -131,12 +133,12 @@ az keyvault restore start --hsm-name mhsmdemo2 --storage-account-name mhsmdemoba
131133

132134
Selective key restore allows you to restore one individual key with all its key versions from a previous backup to an HSM.
133135

134-
### Selective key restore when storage account is behind a private endpoint (preview)
136+
### Selective key restore using user assigned managed identity (preview)
135137
```
136138
az keyvault restore start --hsm-name mhsmdemo2 --storage-account-name mhsmdemobackup --blob-container-name mhsmdemobackupcontainer --backup-folder mhsm-backup-foldername --use-managed-identity true --key-name rsa-key2
137139
```
138140

139-
### Selective key restore when storage account is not behind a private endpoint
141+
### Selective key restore using SAS token
140142
```
141143
az keyvault restore start --hsm-name mhsmdemo2 --storage-account-name mhsmdemobackup --blob-container-name mhsmdemobackupcontainer --storage-container-SAS-token $sas --backup-folder mhsm-mhsmdemo-2020083120161860 -–key-name rsa-key2
142144
```

0 commit comments

Comments
 (0)