Skip to content

Commit 3634879

Browse files
authored
Merge pull request #2656 from msmbaldwin/mhsm-placeholder-standardization
[SCOPED] Standardize placeholders in managed-hsm docset
2 parents 685724e + 8a7b86e commit 3634879

21 files changed

Lines changed: 420 additions & 416 deletions

articles/key-vault/includes/managed-hsm/sdk-role-assignment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ For your application to access keys, assign the appropriate Managed HSM local RB
1414

1515
```azurecli
1616
# Get the principal ID of your managed identity
17-
principalId=$(az vm identity show --name myVM --resource-group myRG --query principalId -o tsv)
17+
principalId=$(az vm identity show --name <vm-name> --resource-group <resource-group> --query principalId -o tsv)
1818
1919
# Assign the Crypto User role for key operations
2020
az keyvault role assignment create \
21-
--hsm-name ContosoMHSM \
21+
--hsm-name <hsm-name> \
2222
--role "Managed HSM Crypto User" \
2323
--assignee $principalId \
2424
--scope /keys

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ To execute a full backup, provide the following information:
4747
1. Provide **Storage Blob Data Contributor** role access to the user-assigned managed identity created in step 2, by going to the **Access Control** tab on the portal and selecting **Add Role Assignment**. Then select **managed identity** and select the managed identity created in step 2 -> **Review + Assign**
4848
1. Create the Managed HSM and associate the managed identity:
4949
```azurecli-interactive
50-
az keyvault create --hsm-name ContosoMHSM -l mhsmlocation --retention-days 7 --administrators "initialadmin" --mi-user-assigned "/subscriptions/subid/resourcegroups/mhsmrgname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userassignedidentitynamefromstep2"
50+
az keyvault create --hsm-name <hsm-name> -l <location> --retention-days 7 --administrators "<initial-admin>" --mi-user-assigned "/subscriptions/<subscription-id>/resourcegroups/<resource-group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<managed-identity-name>"
5151
```
5252
If you have an existing Managed HSM, associate the managed identity by updating the MHSM with the following command.
5353
```azurecli-interactive
54-
az keyvault update-hsm --hsm-name ContosoMHSM --mi-user-assigned "/subscriptions/subid/resourcegroups/mhsmrgname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userassignedidentitynamefromstep2"
54+
az keyvault update-hsm --hsm-name <hsm-name> --mi-user-assigned "/subscriptions/<subscription-id>/resourcegroups/<resource-group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<managed-identity-name>"
5555
```
5656

5757
## Full backup
@@ -65,7 +65,7 @@ While the backup is in progress, the HSM might not operate at full throughput as
6565
6666
### Backup HSM by using user assigned managed identity
6767
```azurecli-interactive
68-
az keyvault backup start --use-managed-identity true --hsm-name ContosoMHSM --storage-account-name contosostorage --blob-container-name contosostoragecontainer
68+
az keyvault backup start --use-managed-identity true --hsm-name <hsm-name> --storage-account-name <storage-account-name> --blob-container-name <container-name>
6969
```
7070
### Backup HSM by using SAS token
7171

@@ -76,19 +76,19 @@ end=$(date -u -d "500 minutes" '+%Y-%m-%dT%H:%MZ')
7676
7777
# Get storage account key
7878
79-
skey=$(az storage account keys list --query '[0].value' -o tsv --account-name contosostorage --subscription {subscription-id})
79+
skey=$(az storage account keys list --query '[0].value' -o tsv --account-name <storage-account-name> --subscription <subscription-id>)
8080
8181
# Create a container
8282
83-
az storage container create --account-name contosostorage --name contosostoragecontainer --account-key $skey
83+
az storage container create --account-name <storage-account-name> --name <container-name> --account-key $skey
8484
8585
# Generate a container sas token
8686
87-
sas=$(az storage container generate-sas -n contosostoragecontainer --account-name contosostorage --permissions crdw --expiry $end --account-key $skey -o tsv --subscription {subscription-id})
87+
sas=$(az storage container generate-sas -n <container-name> --account-name <storage-account-name> --permissions crdw --expiry $end --account-key $skey -o tsv --subscription <subscription-id>)
8888
8989
# Backup HSM
9090
91-
az keyvault backup start --hsm-name ContosoMHSM --storage-account-name contosostorage --blob-container-name contosostoragecontainer --storage-container-SAS-token $sas --subscription {subscription-id}
91+
az keyvault backup start --hsm-name <hsm-name> --storage-account-name <storage-account-name> --blob-container-name <container-name> --storage-container-SAS-token $sas --subscription <subscription-id>
9292
9393
```
9494

@@ -112,7 +112,7 @@ Restore is a long running operation but it immediately returns a Job ID. You can
112112

113113
### Restore HSM by using user assigned managed identity
114114
```azurecli-interactive
115-
az keyvault restore start --hsm-name ContosoMHSM --storage-account-name contosostorage --blob-container-name contosostoragecontainer --backup-folder mhsm-backup-foldername --use-managed-identity true
115+
az keyvault restore start --hsm-name <hsm-name> --storage-account-name <storage-account-name> --blob-container-name <container-name> --backup-folder <backup-folder> --use-managed-identity true
116116
```
117117
### Restore HSM by using SAS token
118118

@@ -123,15 +123,15 @@ end=$(date -u -d "500 minutes" '+%Y-%m-%dT%H:%MZ')
123123
124124
# Get storage account key
125125
126-
skey=$(az storage account keys list --query '[0].value' -o tsv --account-name contosostorage --subscription {subscription-id})
126+
skey=$(az storage account keys list --query '[0].value' -o tsv --account-name <storage-account-name> --subscription <subscription-id>)
127127
128128
# Generate a container sas token
129129
130-
sas=$(az storage container generate-sas -n contosostoragecontainer --account-name contosostorage --permissions rl --expiry $end --account-key $skey -o tsv --subscription {subscription-id})
130+
sas=$(az storage container generate-sas -n <container-name> --account-name <storage-account-name> --permissions rl --expiry $end --account-key $skey -o tsv --subscription <subscription-id>)
131131
132132
# Restore HSM
133133
134-
az keyvault restore start --hsm-name ContosoMHSM --storage-account-name contosostorage --blob-container-name contosostoragecontainer --storage-container-SAS-token $sas --backup-folder mhsm-ContosoMHSM-2020083120161860
134+
az keyvault restore start --hsm-name <hsm-name> --storage-account-name <storage-account-name> --blob-container-name <container-name> --storage-container-SAS-token $sas --backup-folder <backup-folder>
135135
```
136136

137137
## Selective key restore
@@ -140,12 +140,12 @@ Selective key restore restores one key with all its key versions from a previous
140140

141141
### Selective key restore by using user assigned managed identity
142142
```
143-
az keyvault restore start --hsm-name ContosoMHSM --storage-account-name contosostorage --blob-container-name contosostoragecontainer --backup-folder mhsm-backup-foldername --use-managed-identity true --key-name rsa-key2
143+
az keyvault restore start --hsm-name <hsm-name> --storage-account-name <storage-account-name> --blob-container-name <container-name> --backup-folder <backup-folder> --use-managed-identity true --key-name <key-name>
144144
```
145145

146146
### Selective key restore by using SAS token
147147
```
148-
az keyvault restore start --hsm-name ContosoMHSM --storage-account-name contosostorage --blob-container-name contosostoragecontainer --storage-container-SAS-token $sas --backup-folder mhsm-ContosoMHSM-2020083120161860 --key-name rsa-key2
148+
az keyvault restore start --hsm-name <hsm-name> --storage-account-name <storage-account-name> --blob-container-name <container-name> --storage-container-SAS-token $sas --backup-folder <backup-folder> --key-name <key-name>
149149
```
150150

151151
## Next steps

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

Lines changed: 5 additions & 5 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 "ContosoResourceGroup" --hsm-name "ContosoMHSM" --default-action Deny
42+
az keyvault update-hsm --resource-group "<resource-group>" --hsm-name "<hsm-name>" --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 "ContosoResourceGroup" --hsm-name "ContosoMHSM" --ip-address "191.10.18.0/24"
48+
az keyvault network-rule add --resource-group "<resource-group>" --hsm-name "<hsm-name>" --ip-address "<ip-address-range>"
4949
```
5050

5151
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 "ContosoResourceGroup" --hsm-name "ContosoMHSM" --bypass AzureServices
54+
az keyvault update --resource-group "<resource-group>" --hsm-name "<hsm-name>" --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 "ContosoMHSM" -ResourceGroupName "ContosoResourceGroup" -DefaultAction Deny -IpAddressRange @('16.17.18.0/24') -PassThru
65+
Update-AzKeyVaultManagedHsmNetworkRuleSet -Name "<hsm-name>" -ResourceGroupName "<resource-group>" -DefaultAction Deny -IpAddressRange @('<ip-address-range>') -PassThru
6666
```
6767

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

7070
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 "ContosoMHSM" -Bypass AzureServices
73+
Update-AzKeyVaultManagedHsmNetworkRuleSet -Name "<hsm-name>" -Bypass AzureServices
7474
```
7575

7676
---

0 commit comments

Comments
 (0)