Skip to content

Commit 8fd1f80

Browse files
authored
Merge pull request #106814 from TimShererWithAquent/us1669724i
Azure CLI syntax blocks.
2 parents 0fad941 + 6a1b103 commit 8fd1f80

11 files changed

+60
-49
lines changed

articles/dedicated-hsm/tutorial-deploy-hsm-cli.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Assumptions:
4343
- You created a Resource Group for these resources and the new ones deployed in this tutorial will join that group.
4444
- You already created the necessary virtual network, subnet, and virtual machines as per the diagram above and now want to integrate 2 HSMs into that deployment.
4545

46-
All instructions below assume that you have already navigated to the Azure portal and you have opened the Cloud Shell (select \>\_ towards the top right of the portal).
46+
All instructions below assume that you have already navigated to the Azure portal and you have opened the Cloud Shell (select "\>\_" towards the top right of the portal).
4747

4848
## Provisioning a Dedicated HSM
4949

@@ -67,15 +67,15 @@ az feature show \
6767
--name AllowBaremetalServers
6868
```
6969

70-
Both commands should return a status of Registered (as shown below). If the commands don't return "Registered" you need to register for this service, contact your Microsoft account representative.
70+
Both commands should return a status of "Registered" (as shown below). If the commands don't return "Registered" you need to register for this service, contact your Microsoft account representative.
7171

7272
![subscription status](media/tutorial-deploy-hsm-cli/subscription-status.png)
7373

7474
### Creating HSM resources
7575

76-
An HSM is provisioned into a customers virtual network so a virtual network and subnet are required. A dependency for the HSM to enable communication between the virtual network and physical device is an ExpressRoute Gateway, and finally a virtual machine is required to access the HSM device using the Gemalto client software. These resources have been collected into a template file, with corresponding parameter file, for ease of use. The files are available by contacting Microsoft directly as [email protected].
76+
An HSM is provisioned into a customers' virtual network so a virtual network and subnet are required. A dependency for the HSM to enable communication between the virtual network and physical device is an ExpressRoute Gateway, and finally a virtual machine is required to access the HSM device using the Gemalto client software. These resources have been collected into a template file, with corresponding parameter file, for ease of use. The files are available by contacting Microsoft directly as [email protected].
7777

78-
Once you have the files, you must edit the parameter file to insert your preferred names for resources. Edit lines with value”: “”.
78+
Once you have the files, you must edit the parameter file to insert your preferred names for resources. Edit lines with "value": "".
7979

8080
- `namingInfix` Prefix for names of HSM resources
8181
- `ExistingVirtualNetworkName` Name of the virtual network used for the HSMs
@@ -122,7 +122,7 @@ The associated Azure Resource Manager template file will create 6 resources with
122122
- An HSM in stamp 1
123123
- An HSM in stamp 2
124124

125-
Once parameter values are set, the files need to be uploaded to Azure portal cloud shell file share for use. In the Azure portal, click the \>\_ cloud shell symbol top right and this will make the bottom portion of the screen a command environment. The options for this are BASH and PowerShell and you should select BASH if not already set.
125+
Once parameter values are set, the files need to be uploaded to Azure portal cloud shell file share for use. In the Azure portal, click the "\>\_" cloud shell symbol top right and this will make the bottom portion of the screen a command environment. The options for this are BASH and PowerShell and you should select BASH if not already set.
126126

127127
The command shell has an upload/download option on the toolbar and you should select this to upload the template and parameter files to your file share:
128128

@@ -140,7 +140,8 @@ az network vnet create \
140140
```
141141

142142
```azurecli
143-
--vnet-name myHSM-vnet \
143+
az network vnet create \
144+
--vnet-name myHSM-vnet \
144145
--resource-group myRG \
145146
--name hsmsubnet \
146147
--address-prefixes 10.2.1.0/24 \
@@ -156,7 +157,7 @@ az network vnet subnet create \
156157
```
157158

158159
>[!NOTE]
159-
>The most important configuration to note for the virtual network, is that the subnet for the HSM device must have delegations set to Microsoft.HardwareSecurityModules/dedicatedHSMs. The HSM provisioning will not work without this option being set.
160+
>The most important configuration to note for the virtual network, is that the subnet for the HSM device must have delegations set to "Microsoft.HardwareSecurityModules/dedicatedHSMs". The HSM provisioning will not work without this option being set.
160161
161162
Once all pre-requisites are in place, run the following command to use the Azure Resource Manager template ensuring you have updated values with your unique names (at least the resource group name):
162163

@@ -173,7 +174,7 @@ This deployment should take approximately 25 to 30 minutes to complete with the
173174

174175
![provisioning status](media/tutorial-deploy-hsm-cli/progress-status.png)
175176

176-
When the deployment completes successfully provisioningState”: “Succeeded will be displayed. You can connect to your existing virtual machine and use SSH to ensure availability of the HSM device.
177+
When the deployment completes successfully "provisioningState": "Succeeded" will be displayed. You can connect to your existing virtual machine and use SSH to ensure availability of the HSM device.
177178

178179
## Verifying the Deployment
179180

@@ -189,7 +190,7 @@ az resource show \
189190

190191
![provisioning output](media/tutorial-deploy-hsm-cli/progress-status2.png)
191192

192-
You will also now be able to see the resources using the [Azure resource explorer](https://resources.azure.com/). Once in the explorer, expand subscriptions on the left, expand your specific subscription for Dedicated HSM, expand resource groups, expand the resource group you used and finally select the resources item.
193+
You will also now be able to see the resources using the [Azure resource explorer](https://resources.azure.com/). Once in the explorer, expand "subscriptions" on the left, expand your specific subscription for Dedicated HSM, expand "resource groups", expand the resource group you used and finally select the "resources" item.
193194

194195
## Testing the Deployment
195196

@@ -203,9 +204,9 @@ The IP Address of the VM could also be used in place of the DNS name in the abov
203204
![components list](media/tutorial-deploy-hsm-cli/resources.png)
204205

205206
>[!NOTE]
206-
>Notice the Show hidden types checkbox, which when selected will display HSM resources.
207+
>Notice the "Show hidden types" checkbox, which when selected will display HSM resources.
207208
208-
In the screenshot above, clicking the HSM1_HSMnic or HSM2_HSMnic would show the appropriate Private IP Address. Otherwise, the `az resource show` command used above is a way to identify the right IP Address.
209+
In the screenshot above, clicking the "HSM1_HSMnic" or "HSM2_HSMnic" would show the appropriate Private IP Address. Otherwise, the `az resource show` command used above is a way to identify the right IP Address.
209210

210211
When you have the correct IP address, run the following command substituting that address:
211212

articles/key-vault/key-vault-manage-with-cli2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ Enable Key Vault for disk encryption: Required when using the vault for Azure Di
233233

234234
Enable Key Vault for template deployment: Allows Resource Manager to retrieve secrets from the vault.
235235

236-
```azurecli
237-
az keyvault update --name "ContosoKeyVault" --resource-group "ContosoResourceGroup" --enabled-for-template-deployment "true"
238-
```
236+
```azurecli
237+
az keyvault update --name "ContosoKeyVault" --resource-group "ContosoResourceGroup" --enabled-for-template-deployment "true"
238+
```
239239

240240
## Working with Hardware security modules (HSMs)
241241

@@ -261,7 +261,7 @@ You can use the following command to import a key from a .pem file on your compu
261261
az keyvault key import --vault-name "ContosoKeyVaultHSM" --name "ContosoFirstHSMKey" --pem-file "/.softkey.pem" --protection "hsm" --pem-password "PaSSWORD"
262262
```
263263

264-
The next command imports a bring your own key" (BYOK) package. This lets you generate your key in your local HSM, and transfer it to HSMs in the Key Vault service, without the key leaving the HSM boundary:
264+
The next command imports a "bring your own key" (BYOK) package. This lets you generate your key in your local HSM, and transfer it to HSMs in the Key Vault service, without the key leaving the HSM boundary:
265265

266266
```azurecli
267267
az keyvault key import --vault-name "ContosoKeyVaultHSM" --name "ContosoFirstHSMKey" --byok-file "./ITByok.byok" --protection "hsm"

articles/key-vault/key-vault-soft-delete-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ You can enable purge protection only if soft-delete is also enabled.
228228

229229
To turn on both soft delete and purge protection when creating a vault, use the [az keyvault create](/cli/azure/keyvault?view=azure-cli-latest#az-keyvault-create) command:
230230

231-
```
231+
```azurecli
232232
az keyvault create --name ContosoVault --resource-group ContosoRG --location westus --enable-soft-delete true --enable-purge-protection true
233233
```
234234

235235
To add purge protection to an existing vault (that already has soft delete enabled), use the [az keyvault update](/cli/azure/keyvault?view=azure-cli-latest#az-keyvault-update) command:
236236

237-
```
237+
```azurecli
238238
az keyvault update --name ContosoVault --resource-group ContosoRG --enable-purge-protection true
239239
```
240240

articles/key-vault/tutorial-net-linux-virtual-machine.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Before we go any further, read about [key vault basic concepts](basic-concepts.m
4141

4242
## Understand Managed Service Identity
4343

44-
Azure Key Vault can store credentials securely so they arent in your code, but to retrieve them you need to authenticate to Azure Key Vault. However, to authenticate to Key Vault, you need a credential. It's a classic bootstrap problem. With Azure and Azure Active Directory (Azure AD), Managed Service Identity (MSI) can provide a bootstrap identity that makes it much simpler to get things started.
44+
Azure Key Vault can store credentials securely so they aren't in your code, but to retrieve them you need to authenticate to Azure Key Vault. However, to authenticate to Key Vault, you need a credential. It's a classic bootstrap problem. With Azure and Azure Active Directory (Azure AD), Managed Service Identity (MSI) can provide a bootstrap identity that makes it much simpler to get things started.
4545

4646
When you enable MSI for an Azure service like Virtual Machines, App Service, or Functions, Azure creates a service principal for the instance of the service in Azure Active Directory. It injects the credentials for the service principal into the instance of the service.
4747

@@ -112,7 +112,7 @@ az vm create \
112112

113113
It takes a few minutes to create the VM and supporting resources. The following example output shows that the VM create operation was successful.
114114

115-
```azurecli
115+
```output
116116
{
117117
"fqdns": "",
118118
"id": "/subscriptions/<guid>/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
@@ -137,7 +137,7 @@ az vm identity assign --name <NameOfYourVirtualMachine> --resource-group <YourRe
137137

138138
The output of the command should be:
139139

140-
```azurecli
140+
```output
141141
{
142142
"systemAssignedIdentity": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
143143
"userAssignedIdentities": {}

articles/key-vault/tutorial-net-windows-virtual-machine.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ az vm identity assign --name <NameOfYourVirtualMachine> --resource-group <YourRe
115115

116116
Note the system-assigned identity that's displayed in the following code. The output of the preceding command would be:
117117

118-
```azurecli
118+
```output
119119
{
120120
"systemAssignedIdentity": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
121121
"userAssignedIdentities": {}
@@ -155,9 +155,9 @@ dotnet run
155155

156156
### Install the packages
157157

158-
From the console window, install the .NET packages required for this quickstart:
158+
From the console window, install the .NET packages required for this quickstart:
159159

160-
```console
160+
```console
161161
dotnet add package System.IO;
162162
dotnet add package System.Net;
163163
dotnet add package System.Text;

articles/key-vault/tutorial-python-linux-virtual-machine.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Before you go any further, make sure you understand the [basic concepts about Ke
4040

4141
## Understand Managed Service Identity
4242

43-
Azure Key Vault can store credentials securely so they arent in your code. To retrieve them, you need to authenticate to Azure Key Vault. However, to authenticate to Key Vault, you need a credential. It's a classic bootstrap problem. Through Azure and Azure Active Directory (Azure AD), Managed Service Identity (MSI) provides a bootstrap identity that makes it simpler to get things started.
43+
Azure Key Vault can store credentials securely so they aren't in your code. To retrieve them, you need to authenticate to Azure Key Vault. However, to authenticate to Key Vault, you need a credential. It's a classic bootstrap problem. Through Azure and Azure Active Directory (Azure AD), Managed Service Identity (MSI) provides a bootstrap identity that makes it simpler to get things started.
4444

4545
When you enable MSI for an Azure service like Virtual Machines, App Service, or Functions, Azure creates a service principal for the instance of the service in Azure AD. It injects the credentials for the service principal into the instance of the service.
4646

@@ -110,7 +110,7 @@ az vm create \
110110

111111
It takes a few minutes to create the VM and supporting resources. The following example output shows that the VM creation was successful:
112112

113-
```azurecli
113+
```output
114114
{
115115
"fqdns": "",
116116
"id": "/subscriptions/<guid>/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
@@ -135,7 +135,7 @@ az vm identity assign --name <NameOfYourVirtualMachine> --resource-group <YourRe
135135

136136
The output of the command is as follows.
137137

138-
```azurecli
138+
```output
139139
{
140140
"systemAssignedIdentity": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
141141
"userAssignedIdentities": {}

articles/key-vault/tutorial-python-windows-virtual-machine.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ az vm identity assign --name <NameOfYourVirtualMachine> --resource-group <YourRe
114114

115115
Note the system-assigned identity that's displayed in the following code. The output of the preceding command would be:
116116

117-
```azurecli
117+
```output
118118
{
119119
"systemAssignedIdentity": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
120120
"userAssignedIdentities": {}
@@ -145,7 +145,7 @@ The code presents a two-step process:
145145
Doing so also fetches a token from Azure AD.
146146
1. Pass the token to your key vault, and then fetch your secret.
147147

148-
```
148+
```python
149149
# importing the requests library
150150
import requests
151151

@@ -167,7 +167,7 @@ The code presents a two-step process:
167167

168168
You can display the secret value by running the following code:
169169

170-
```
170+
```console
171171
python Sample.py
172172
```
173173

articles/load-balancer/load-balancer-configure-ha-ports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ lbrule = New-AzLoadBalancerRuleConfig -Name "HAPortsRule" -FrontendIpConfigurati
9393
In step 4 of [Create an internal load balancer set](load-balancer-get-started-ilb-arm-cli.md), use the following command to create the High Availability Ports load balancer rule:
9494

9595
```azurecli
96-
azure network lb rule create --resource-group contoso-rg --lb-name contoso-ilb --name haportsrule --protocol all --frontend-port 0 --backend-port 0 --frontend-ip-name feilb --backend-address-pool-name beilb
96+
az network lb rule create --resource-group contoso-rg --lb-name contoso-ilb --name haportsrule --protocol all --frontend-port 0 --backend-port 0 --frontend-ip-name feilb --backend-address-pool-name beilb
9797
```
9898

9999
## Next steps

articles/load-balancer/load-balancer-get-started-ilb-arm-cli.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The following example creates a resource group named *myResourceGroupILB* in the
3333
--name myResourceGroupILB \
3434
--location eastus
3535
```
36+
3637
## Create a virtual network
3738

3839
Create a virtual network named *myVnet* with a subnet named *mySubnet* in the *myResourceGroup* using [az network vnet create](https://docs.microsoft.com/cli/azure/network/vnet).
@@ -44,6 +45,7 @@ Create a virtual network named *myVnet* with a subnet named *mySubnet* in the *m
4445
--location eastus \
4546
--subnet-name mySubnet
4647
```
48+
4749
## Create Basic Load Balancer
4850

4951
This section details how you can create and configure the following components of the load balancer:
@@ -65,7 +67,8 @@ Create an internal Load Balancer with [az network lb create](https://docs.micros
6567
--backend-pool-name myBackEndPool \
6668
--vnet-name myVnet \
6769
--subnet mySubnet
68-
```
70+
```
71+
6972
### Create the health probe
7073

7174
A health probe checks all virtual machine instances to make sure they can receive network traffic. The virtual machine instance with failed probe checks is removed from the load balancer until it goes back online and a probe check determines that it's healthy. Create a health probe with [az network lb probe create](https://docs.microsoft.com/cli/azure/network/lb/probe?view=azure-cli-latest) to monitor the health of the virtual machines.
@@ -124,7 +127,7 @@ In this example, you create two virtual machines to be used as backend servers f
124127

125128
Create an availability set with [az vm availabilityset create](/cli/azure/network/nic)
126129

127-
```azurecli-interactive
130+
```azurecli-interactive
128131
az vm availability-set create \
129132
--resource-group myResourceGroupILB \
130133
--name myAvailabilitySet
@@ -174,11 +177,11 @@ runcmd:
174177
- npm init
175178
- npm install express -y
176179
- nodejs index.js
177-
```
178-
180+
```
181+
179182
Create the virtual machines with [az vm create](/cli/azure/vm#az-vm-create).
180183
181-
```azurecli-interactive
184+
```azurecli-interactive
182185
for i in `seq 1 2`; do
183186
az vm create \
184187
--resource-group myResourceGroupILB \
@@ -190,6 +193,7 @@ for i in `seq 1 2`; do
190193
--custom-data cloud-init.txt
191194
done
192195
```
196+
193197
It may take a few minutes for the VMs to get deployed.
194198

195199
### Create a VM for testing the load balancer
@@ -215,14 +219,15 @@ To get the private IP address of the load balancer, use [az network lb show](/cl
215219
az network lb show \
216220
--name myLoadBalancer \
217221
--resource-group myResourceGroupILB
218-
```
222+
```
223+
219224
![Test load balancer](./media/load-balancer-get-started-ilb-arm-cli/load-balancer-test.png)
220225

221226
## Clean up resources
222227

223228
When no longer needed, you can use the [az group delete](/cli/azure/group#az-group-delete) command to remove the resource group, load balancer, and all related resources.
224229

225-
```azurecli-interactive
230+
```azurecli-interactive
226231
az group delete --name myResourceGroupILB
227232
```
228233

articles/load-balancer/load-balancer-get-started-ilb-arm-template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ To deploy the template you downloaded by using PowerShell, follow the steps belo
5353
To deploy the template by using the Azure CLI, follow the steps below.
5454
5555
1. If you have never used Azure CLI, see [Install and Configure the Azure CLI](../cli-install-nodejs.md) and follow the instructions up to the point where you select your Azure account and subscription.
56-
2. Run the **azure config mode** command to switch to Resource Manager mode, as shown below.
56+
2. Go to [https://shell.azure.com](https://shell.azure.com) to open Cloud Shell in your browser. Run the **azure config mode** command to switch to Resource Manager mode, as shown below.
5757
58-
```azurecli-interactive
58+
```console
5959
azure config mode arm
6060
```
6161
@@ -66,7 +66,7 @@ To deploy the template by using the Azure CLI, follow the steps below.
6666
3. Open the parameter file, select its contents, and save it to a file in your computer. For this example, we saved the parameters file to *parameters.json*.
6767
4. Run the **azure group deployment create** command to deploy the new internal load balancer by using the template and parameter files you downloaded and modified above. The list shown after the output explains the parameters used.
6868
69-
```azurecli
69+
```console
7070
azure group create --name TestRG --location westus --template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-2-vms-internal-load-balancer/azuredeploy.json --parameters-file parameters.json
7171
```
7272

0 commit comments

Comments
 (0)