Skip to content

Commit 2cf1dbb

Browse files
Syntax blocks azurecli.
1 parent e4c4258 commit 2cf1dbb

15 files changed

+113
-92
lines changed

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/windows/image-builder-gallery-update-image-version.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ If you used [Create an image and distribute to a Shared Image Gallery](image-bui
5555

5656
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.
5757

58-
```azurecli-interactive
58+
```console
5959
# Resource group name - we are using ibsigRG in this example
6060
sigResourceGroup=myIBWinRG
6161
# Datacenter location - we are using West US 2 in this example
@@ -75,7 +75,7 @@ vmpassword="password for the VM"
7575

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

78-
```azurecli-interactive
78+
```console
7979
subscriptionID=<Subscription ID>
8080
```
8181

@@ -107,7 +107,7 @@ You can review the example we are about to use by opening the .json file here: [
107107

108108
Download the .json example and configure it with your variables.
109109

110-
```azurecli-interactive
110+
```console
111111
curl https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/8_Creating_a_Custom_Win_Shared_Image_Gallery_Image_from_SIG/helloImageTemplateforSIGfromWinSIG.json -o helloImageTemplateforSIGfromWinSIG.json
112112
sed -i -e "s/<subscriptionID>/$subscriptionID/g" helloImageTemplateforSIGfromWinSIG.json
113113
sed -i -e "s/<rgName>/$sigResourceGroup/g" helloImageTemplateforSIGfromWinSIG.json

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

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

6464

65-
```azurecli-interactive
65+
```console
6666
# Resource group name - we are using myImageBuilderRG in this example
6767
imageResourceGroup=myWinImgBuilderRG
6868
# Region location
@@ -77,7 +77,7 @@ imageName=aibWinImage
7777

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

80-
```azurecli-interactive
80+
```console
8181
subscriptionID=<Your subscription ID>
8282
```
8383
## Create a resource group
@@ -106,7 +106,7 @@ az role assignment create \
106106

107107
A parameterized image configuration template has been created for you to try. Download the example .json file and configure it with the variables you set previously.
108108

109-
```azurecli-interactive
109+
```console
110110
curl https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/0_Creating_a_Custom_Windows_Managed_Image/helloImageTemplateWin.json -o helloImageTemplateWin.json
111111

112112
sed -i -e "s/<subscriptionID>/$subscriptionID/g" helloImageTemplateWin.json
@@ -119,7 +119,7 @@ sed -i -e "s/<runOutputName>/$runOutputName/g" helloImageTemplateWin.json
119119

120120
You can modify this example, in the terminal using a text editor like `vi`.
121121

122-
```azurecli-interactive
122+
```console
123123
vi helloImageTemplateLinux.json
124124
```
125125

@@ -205,6 +205,7 @@ You should see these two directories created during image customization:
205205
When you are done, delete the resources.
206206

207207
### Delete the image builder template
208+
208209
```azurecli-interactive
209210
az resource delete \
210211
--resource-group $imageResourceGroup \
@@ -213,6 +214,7 @@ az resource delete \
213214
```
214215

215216
### Delete the image resource group
217+
216218
```azurecli-interactive
217219
az group delete -n $imageResourceGroup
218220
```

articles/virtual-machines/windows/quick-create-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ az vm create \
5656

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

59-
```azurecli-interactive
59+
```output
6060
{
6161
"fqdns": "",
6262
"id": "/subscriptions/<guid>/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",

articles/virtual-machines/windows/template-description.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This example shows a typical resource section of a template for creating a speci
153153

154154
When you deploy resources using a template, you have to specify a version of the API to use. The example shows the virtual machine resource using this apiVersion element:
155155

156-
```
156+
```json
157157
"apiVersion": "2016-04-30-preview",
158158
```
159159

@@ -170,7 +170,7 @@ Use these opportunities for getting the latest API versions:
170170

171171
[Parameters](../../resource-group-authoring-templates.md) make it easy for you to specify values for the template when you run it. This parameters section is used in the example:
172172

173-
```
173+
```json
174174
"parameters": {
175175
"adminUsername": { "type": "string" },
176176
"adminPassword": { "type": "securestring" },
@@ -182,7 +182,7 @@ When you deploy the example template, you enter values for the name and password
182182

183183
[Variables](../../resource-group-authoring-templates.md) make it easy for you to set up values in the template that are used repeatedly throughout it or that can change over time. This variables section is used in the example:
184184

185-
```
185+
```json
186186
"variables": {
187187
"storageName": "mystore1",
188188
"accountid": "[concat('/subscriptions/', subscription().subscriptionId,
@@ -219,7 +219,7 @@ When you deploy the example template, variable values are used for the name and
219219

220220
When you need more than one virtual machine for your application, you can use a copy element in a template. This optional element loops through creating the number of VMs that you specified as a parameter:
221221

222-
```
222+
```json
223223
"copy": {
224224
"name": "virtualMachineLoop",
225225
"count": "[parameters('numberOfInstances')]"
@@ -228,7 +228,7 @@ When you need more than one virtual machine for your application, you can use a
228228

229229
Also, notice in the example that the loop index is used when specifying some of the values for the resource. For example, if you entered an instance count of three, the names of the operating system disks are myOSDisk1, myOSDisk2, and myOSDisk3:
230230

231-
```
231+
```json
232232
"osDisk": {
233233
"name": "[concat('myOSDisk', copyindex())]",
234234
"caching": "ReadWrite",
@@ -243,7 +243,7 @@ Also, notice in the example that the loop index is used when specifying some of
243243
244244
Keep in mind that creating a loop for one resource in the template may require you to use the loop when creating or accessing other resources. For example, multiple VMs can’t use the same network interface, so if your template loops through creating three VMs it must also loop through creating three network interfaces. When assigning a network interface to a VM, the loop index is used to identify it:
245245

246-
```
246+
```json
247247
"networkInterfaces": [ {
248248
"id": "[resourceId('Microsoft.Network/networkInterfaces',
249249
concat('myNIC', copyindex()))]"
@@ -254,7 +254,7 @@ Keep in mind that creating a loop for one resource in the template may require y
254254

255255
Most resources depend on other resources to work correctly. Virtual machines must be associated with a virtual network and to do that it needs a network interface. The [dependsOn](../../resource-group-define-dependencies.md) element is used to make sure that the network interface is ready to be used before the VMs are created:
256256

257-
```
257+
```json
258258
"dependsOn": [
259259
"[concat('Microsoft.Network/networkInterfaces/', 'myNIC', copyindex())]"
260260
],
@@ -264,7 +264,7 @@ Resource Manager deploys in parallel any resources that aren't dependent on anot
264264

265265
How do you know if a dependency is required? Look at the values you set in the template. If an element in the virtual machine resource definition points to another resource that is deployed in the same template, you need a dependency. For example, your example virtual machine defines a network profile:
266266

267-
```
267+
```json
268268
"networkProfile": {
269269
"networkInterfaces": [ {
270270
"id": "[resourceId('Microsoft.Network/networkInterfaces',
@@ -293,7 +293,7 @@ In Azure, vhd files can represent [disks or images](managed-disks-overview.md?to
293293

294294
When you create a VM, you must decide what operating system to use. The imageReference element is used to define the operating system of a new VM. The example shows a definition for a Windows Server operating system:
295295

296-
```
296+
```json
297297
"imageReference": {
298298
"publisher": "MicrosoftWindowsServer",
299299
"offer": "WindowsServer",
@@ -304,7 +304,7 @@ When you create a VM, you must decide what operating system to use. The imageRef
304304

305305
If you want to create a Linux operating system, you might use this definition:
306306

307-
```
307+
```json
308308
"imageReference": {
309309
"publisher": "Canonical",
310310
"offer": "UbuntuServer",
@@ -315,7 +315,7 @@ If you want to create a Linux operating system, you might use this definition:
315315

316316
Configuration settings for the operating system disk are assigned with the osDisk element. The example defines a new managed disk with the caching mode set to **ReadWrite** and that the disk is being created from a [platform image](cli-ps-findimage.md):
317317

318-
```
318+
```json
319319
"osDisk": {
320320
"name": "[concat('myOSDisk', copyindex())]",
321321
"caching": "ReadWrite",
@@ -327,7 +327,7 @@ Configuration settings for the operating system disk are assigned with the osDis
327327

328328
If you want to create virtual machines from existing disks, remove the imageReference and the osProfile elements and define these disk settings:
329329

330-
```
330+
```json
331331
"osDisk": {
332332
"osType": "Windows",
333333
"managedDisk": {
@@ -342,7 +342,7 @@ If you want to create virtual machines from existing disks, remove the imageRefe
342342

343343
If you want to create a virtual machine from a managed image, change the imageReference element and define these disk settings:
344344

345-
```
345+
```json
346346
"storageProfile": {
347347
"imageReference": {
348348
"id": "[resourceId('Microsoft.Compute/images', 'myImage')]"
@@ -360,7 +360,7 @@ If you want to create a virtual machine from a managed image, change the imageRe
360360

361361
You can optionally add data disks to the VMs. The [number of disks](sizes.md) depends on the size of operating system disk that you use. With the size of the VMs set to Standard_DS1_v2, the maximum number of data disks that could be added to the them is two. In the example, one managed data disk is being added to each VM:
362362

363-
```
363+
```json
364364
"dataDisks": [
365365
{
366366
"name": "[concat('myDataDisk', copyindex())]",
@@ -376,7 +376,7 @@ You can optionally add data disks to the VMs. The [number of disks](sizes.md) de
376376

377377
Although [extensions](extensions-features.md) are a separate resource, they're closely tied to VMs. Extensions can be added as a child resource of the VM or as a separate resource. The example shows the [Diagnostics Extension](extensions-diagnostics-template.md) being added to the VMs:
378378

379-
```
379+
```json
380380
{
381381
"name": "Microsoft.Insights.VMDiagnosticsSettings",
382382
"type": "extensions",
@@ -411,7 +411,7 @@ This extension resource uses the storageName variable and the diagnostic variabl
411411

412412
There are many extensions that you can install on a VM, but the most useful is probably the [Custom Script Extension](extensions-customscript.md). In the example, a PowerShell script named start.ps1 runs on each VM when it first starts:
413413

414-
```
414+
```json
415415
{
416416
"name": "MyCustomScriptExtension",
417417
"type": "extensions",

0 commit comments

Comments
 (0)