Skip to content

Commit d1a8169

Browse files
authored
Merge pull request #108308 from TimShererWithAquent/us1669724o
Azure CLI syntax blocks.
2 parents 48bec0c + b15e597 commit d1a8169

12 files changed

+50
-42
lines changed

articles/virtual-machines/extensions/extensions-rmpolicy-howto-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This example shows you how to deny installing extensions published by 'Microsoft
3131

3232
In a [bash Cloud Shell](https://shell.azure.com/bash), type:
3333

34-
```azurecli-interactive
34+
```bash
3535
vim ~/clouddrive/azurepolicy.rules.json
3636
```
3737

@@ -72,7 +72,7 @@ This example shows you how to create a parameters file for Linux VMs in Cloud Sh
7272

7373
In the [bash Cloud Shell](https://shell.azure.com/bash), type:
7474

75-
```azurecli-interactive
75+
```bash
7676
vim ~/clouddrive/azurepolicy.parameters.json
7777
```
7878

articles/virtual-machines/linux/image-builder-gallery-update-image-version.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ If you used [Create an image and distribute to a Shared Image Gallery](image-bui
5353
For Preview, image builder will only support creating custom images in the same Resource Group as the source managed image. Update the resource group name in this example to be the same resource group as your source managed image.
5454

5555

56-
```azurecli-interactive
56+
```console
5757
# Resource group name
5858
sigResourceGroup=ibLinuxGalleryRG
5959
# Gallery location
@@ -70,13 +70,13 @@ runOutputName=aibSIGLinuxUpdate
7070

7171
Create a variable for your subscription ID. You can get this using `az account show | grep id`.
7272

73-
```azurecli-interactive
73+
```console
7474
subscriptionID=<Subscription ID>
7575
```
7676

7777
Get the image version that you want to update.
7878

79-
```
79+
```azurecli
8080
sigDefImgVersionId=$(az sig image-version list \
8181
-g $sigResourceGroup \
8282
--gallery-name $sigName \
@@ -102,7 +102,7 @@ You can review the example we are about to use by opening the .json file here: [
102102

103103
Download the .json example and configure it with your variables.
104104

105-
```azurecli-interactive
105+
```console
106106
curl https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/8_Creating_a_Custom_Linux_Shared_Image_Gallery_Image_from_SIG/helloImageTemplateforSIGfromSIG.json -o helloImageTemplateforSIGfromSIG.json
107107
sed -i -e "s/<subscriptionID>/$subscriptionID/g" helloImageTemplateforSIGfromSIG.json
108108
sed -i -e "s/<rgName>/$sigResourceGroup/g" helloImageTemplateforSIGfromSIG.json
@@ -154,13 +154,13 @@ az vm create \
154154

155155
Create an SSH connection to the VM using the public IP address of the VM.
156156

157-
```azurecli-interactive
157+
```console
158158
ssh azureuser@<pubIp>
159159
```
160160

161161
You should see the image was customized with a "Message of the Day" as soon as your SSH connection is established.
162162

163-
```console
163+
```output
164164
*******************************************************
165165
** This VM was built from the: **
166166
** !! AZURE VM IMAGE BUILDER Custom Image !! **

articles/virtual-machines/linux/image-builder-user-assigned-identity.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ az provider register -n Microsoft.Storage
5959
We will be using some pieces of information repeatedly, so we will create some variables to store that information.
6060

6161

62-
```azurecli-interactive
62+
```console
6363
# Image resource group name
6464
imageResourceGroup=aibmdimsi
6565
# storage resource group
@@ -74,13 +74,13 @@ runOutputName=u1804ManImgMsiro
7474

7575
Create a variable for your subscription ID. You can get this using `az account show | grep id`.
7676

77-
```azurecli-interactive
77+
```console
7878
subscriptionID=<Your subscription ID>
7979
```
8080

8181
Create the resource groups for both the image and the script storage.
8282

83-
```azurecli-interactive
83+
```console
8484
# create resource group for image template
8585
az group create -n $imageResourceGroup -l $location
8686
# create resource group for the script storage
@@ -148,7 +148,7 @@ imgBuilderId=/subscriptions/$subscriptionID/resourcegroups/$imageResourceGroup/p
148148

149149
Download the example .json file and configure it with the variables you created.
150150

151-
```azurecli-interactive
151+
```console
152152
curl https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/7_Creating_Custom_Image_using_MSI_to_Access_Storage/helloImageTemplateMsi.json -o helloImageTemplateMsi.json
153153
sed -i -e "s/<subscriptionID>/$subscriptionID/g" helloImageTemplateMsi.json
154154
sed -i -e "s/<rgName>/$imageResourceGroup/g" helloImageTemplateMsi.json
@@ -188,7 +188,7 @@ Wait for the build to complete. This can take about 15 minutes.
188188

189189
Create a VM from the image.
190190

191-
```bash
191+
```azurecli
192192
az vm create \
193193
--resource-group $imageResourceGroup \
194194
--name aibImgVm00 \
@@ -200,13 +200,13 @@ az vm create \
200200

201201
After the VM has been created, start an SSH session with the VM.
202202

203-
```azurecli-interactive
203+
```console
204204
ssh aibuser@<publicIp>
205205
```
206206

207207
You should see the image was customized with a Message of the Day as soon as your SSH connection is established!
208208

209-
```console
209+
```output
210210
211211
*******************************************************
212212
** This VM was built from the: **

articles/virtual-machines/linux/image-builder.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ az provider register -n Microsoft.Storage
6060
We will be using some pieces of information repeatedly, so we will create some variables to store that information.
6161

6262

63-
```azurecli-interactive
63+
```console
6464
# Resource group name - we are using myImageBuilderRG in this example
6565
imageResourceGroup=myImageBuilerRGLinux
6666
# Datacenter location - we are using West US 2 in this example
@@ -73,7 +73,7 @@ runOutputName=aibLinux
7373

7474
Create a variable for your subscription ID. You can get this using `az account show | grep id`.
7575

76-
```azurecli-interactive
76+
```console
7777
subscriptionID=<Your subscription ID>
7878
```
7979

@@ -100,7 +100,7 @@ az role assignment create \
100100

101101
A parameterized sample image configuration template has been created for you to use. Download the sample .json file and configure it with the variables you set earlier.
102102

103-
```azurecli-interactive
103+
```bash
104104
curl https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/0_Creating_a_Custom_Linux_Managed_Image/helloImageTemplateLinux.json -o helloImageTemplateLinux.json
105105

106106
sed -i -e "s/<subscriptionID>/$subscriptionID/g" helloImageTemplateLinux.json
@@ -112,7 +112,7 @@ sed -i -e "s/<runOutputName>/$runOutputName/g" helloImageTemplateLinux.json
112112

113113
You can modify this example .json as needed. For example, you can increase the value of `buildTimeoutInMinutes` to allow for longer running builds. You can edit the file in Cloud Shell using a text editor like `vi`.
114114

115-
```azurecli-interactive
115+
```bash
116116
vi helloImageTemplateLinux.json
117117
```
118118

@@ -184,13 +184,13 @@ az vm create \
184184

185185
Get the IP address from the output of creating the VM and use it to SSH to the VM.
186186

187-
```azurecli-interactive
187+
```bash
188188
ssh azureuser@<pubIp>
189189
```
190190

191191
You should see the image was customized with a Message of the Day as soon as your SSH connection is established!
192192

193-
```console
193+
```output
194194
195195
*******************************************************
196196
** This VM was built from the: **
@@ -205,7 +205,7 @@ Type `exit` when you are done to close the SSH connection.
205205

206206
In the Image Builder Template, in the 'Properties', you will see the source image, customization script it runs, and where it is distributed.
207207

208-
```azurecli-interactive
208+
```bash
209209
cat helloImageTemplateLinux.json
210210
```
211211

@@ -226,7 +226,7 @@ az resource delete \
226226

227227
Delete the image resource group.
228228

229-
```bash
229+
```azurecli
230230
az group delete -n $imageResourceGroup
231231
```
232232

articles/virtual-machines/linux/login-using-aad.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ az vm show --resource-group myResourceGroup --name myVM -d --query publicIps -o
144144

145145
Log in to the Azure Linux virtual machine using your Azure AD credentials. The `-l` parameter lets you specify your own Azure AD account address. Replace the example account with your own. Account addresses should be entered in all lowercase. Replace the example IP address with the public IP address of your VM from the previous command.
146146

147-
```azurecli-interactive
147+
```console
148148
ssh -l [email protected] 10.11.123.456
149149
```
150150

@@ -165,6 +165,7 @@ The first time that you run sudo, you will be asked to authenticate a second tim
165165
```bash
166166
%aad_admins ALL=(ALL) ALL
167167
```
168+
168169
With this line:
169170

170171
```bash
@@ -180,7 +181,7 @@ Some common errors when you try to SSH with Azure AD credentials include no RBAC
180181

181182
If you see the following error on your SSH prompt, verify that you have configured RBAC policies for the VM that grants the user either the *Virtual Machine Administrator Login* or *Virtual Machine User Login* role:
182183

183-
```bash
184+
```output
184185
185186
Using keyboard-interactive authentication.
186187
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code FJX327AXD to authenticate. Press ENTER when ready.

articles/virtual-machines/linux/nsg-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In the following examples, replace example parameter names with your own values.
2424
## Quickly open a port for a VM
2525
If you need to quickly open a port for a VM in a dev/test scenario, you can use the [az vm open-port](/cli/azure/vm) command. This command creates a Network Security Group, adds a rule, and applies it to a VM or subnet. The following example opens port *80* on the VM named *myVM* in the resource group named *myResourceGroup*.
2626

27-
```azure-cli
27+
```azurecli
2828
az vm open-port --resource-group myResourceGroup --name myVM --port 80
2929
```
3030

articles/virtual-machines/linux/sa-upload-vhd.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ az storage account keys list --resource-group myResourceGroup --account-name mys
149149

150150
The output is similar to:
151151

152-
```azurecli
152+
```output
153153
info: Executing command storage account keys list
154154
+ Getting storage account keys
155155
data: Name Key Permissions
@@ -158,6 +158,7 @@ data: key1 d4XAvZzlGAgWdvhlWfkZ9q4k9bYZkXkuPCJ15NTsQOeDeowCDAdB80r9zA/tUINAp
158158
data: key2 Ww0T7g4UyYLaBnLYcxIOTVziGAAHvU+wpwuPvK4ZG0CDFwu/mAxS/YYvAQGHocq1w7/3HcalbnfxtFdqoXOw8g== Full
159159
info: storage account keys list command OK
160160
```
161+
161162
Make a note of `key1` as you will use it to interact with your storage account in the next steps.
162163

163164
## Create a storage container

articles/virtual-machines/linux/tutorial-automate-vm-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ To see cloud-init in action, create a VM that installs NGINX and runs a simple '
5656

5757
At your bash prompt or in the Cloud Shell, create a file named *cloud-init.txt* and paste the following configuration. For example, type `sensible-editor cloud-init.txt` to create the file and see a list of available editors. Make sure that the whole cloud-init file is copied correctly, especially the first line:
5858

59-
```azurecli-interactive
59+
```bash
6060
#cloud-config
6161
package_upgrade: true
6262
packages:

articles/virtual-machines/linux/tutorial-elasticsearch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Create a resource group with the [az group create](/cli/azure/group) command. An
4040

4141
The following example creates a resource group named *myResourceGroup* in the *eastus* location.
4242

43-
```azurecli-interactive
43+
```azurecli-interactive
4444
az group create --name myResourceGroup --location eastus
4545
```
4646

@@ -50,7 +50,7 @@ Create a VM with the [az vm create](/cli/azure/vm) command.
5050

5151
The following example creates a VM named *myVM* and creates SSH keys if they do not already exist in a default key location. To use a specific set of keys, use the `--ssh-key-value` option.
5252

53-
```azurecli-interactive
53+
```azurecli-interactive
5454
az vm create \
5555
--resource-group myResourceGroup \
5656
--name myVM \
@@ -61,7 +61,7 @@ az vm create \
6161

6262
When the VM has been created, the Azure CLI shows information similar to the following example. Take note of the `publicIpAddress`. This address is used to access the VM.
6363

64-
```azurecli-interactive
64+
```output
6565
{
6666
"fqdns": "",
6767
"id": "/subscriptions/<subscription ID>/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",

articles/virtual-machines/linux/tutorial-manage-disks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Once a disk has been attached to the virtual machine, the operating system needs
115115

116116
Create an SSH connection with the virtual machine. Replace the example IP address with the public IP of the virtual machine.
117117

118-
```azurecli-interactive
118+
```console
119119
ssh 10.101.10.10
120120
```
121121

0 commit comments

Comments
 (0)