You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/windows/template-description.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,18 @@ ms.service: virtual-machines
6
6
ms.workload: infrastructure
7
7
ms.custom: devx-track-arm-template
8
8
ms.topic: how-to
9
-
ms.date: 01/03/2019
9
+
ms.date: 04/11/2023
10
10
ms.author: cynthn
11
11
---
12
12
13
13
# Virtual machines in an Azure Resource Manager template
14
-
**Applies to:**:heavy_check_mark: Windows VMs
14
+
15
+
**Applies to:**:heavy_check_mark: Windows VMs
15
16
16
17
This article describes aspects of an Azure Resource Manager template that apply to virtual machines. This article doesn't describe a complete template for creating a virtual machine; for that you need resource definitions for storage accounts, network interfaces, public IP addresses, and virtual networks. For more information about how these resources can be defined together, see the [Resource Manager template walkthrough](../../azure-resource-manager/templates/quickstart-create-templates-use-the-portal.md).
17
18
18
19
There are many [templates in the gallery](https://azure.microsoft.com/resources/templates/?term=VM) that include the VM resource. Not all elements that can be included in a template are described here.
19
20
20
-
21
-
22
21
This example shows a typical resource section of a template for creating a specified number of VMs:
23
22
24
23
```json
@@ -134,9 +133,9 @@ This example shows a typical resource section of a template for creating a speci
134
133
]
135
134
}
136
135
]
137
-
```
136
+
```
138
137
139
-
> [!NOTE]
138
+
> [!NOTE]
140
139
>This example relies on a storage account that was previously created. You could create the storage account by deploying it from the template. The example also relies on a network interface and its dependent resources that would be defined in the template. These resources are not shown in the example.
141
140
>
142
141
>
@@ -157,7 +156,6 @@ Use these opportunities for getting the latest API versions:
[Parameters](../../azure-resource-manager/templates/syntax.md) make it easy for you to specify values for the template when you run it. This parameters section is used in the example:
@@ -228,7 +226,7 @@ Also, notice in the example that the loop index is used when specifying some of
228
226
}
229
227
```
230
228
231
-
> [!NOTE]
229
+
> [!NOTE]
232
230
>This example uses managed disks for the virtual machines.
233
231
>
234
232
>
@@ -270,17 +268,17 @@ To set this property, the network interface must exist. Therefore, you need a de
270
268
## Profiles
271
269
272
270
Several profile elements are used when defining a virtual machine resource. Some are required and some are optional. For example, the hardwareProfile, osProfile, storageProfile, and networkProfile elements are required, but the diagnosticsProfile is optional. These profiles define settings such as:
273
-
271
+
274
272
-[size](../sizes.md)
275
273
-[name](/azure/architecture/best-practices/resource-naming) and credentials
276
274
- disk and [operating system settings](cli-ps-findimage.md)
In Azure, vhd files can represent [disks or images](../managed-disks-overview.md). When the operating system in a vhd file is specialized to be a specific VM, it's referred to as a disk. When the operating system in a vhd file is generalized to be used to create many VMs, it's referred to as an image.
283
-
281
+
284
282
### Create new virtual machines and new disks from a platform image
285
283
286
284
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:
@@ -300,11 +298,14 @@ If you want to create a Linux operating system, you might use this definition:
300
298
"imageReference": {
301
299
"publisher": "Canonical",
302
300
"offer": "UbuntuServer",
303
-
"sku": "14.04.2-LTS",
301
+
"sku": "20.04.2-LTS",
304
302
"version": "latest"
305
303
},
306
304
```
307
305
306
+
> [!NOTE]
307
+
> Modify `publisher`, `offer`, `sku` and `version` values accordingly.
308
+
308
309
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):
309
310
310
311
```json
@@ -443,7 +444,7 @@ When you deploy a template, Azure tracks the resources that you deployed as a gr
443
444
If you're curious about the status of resources in the deployment, view the resource group in the Azure portal:
It's not a problem to use the same template to create resources or to update existing resources. When you use commands to deploy templates, you have the opportunity to say which [mode](../../azure-resource-manager/templates/deploy-powershell.md) you want to use. The mode can be set to either **Complete** or **Incremental**. The default is to do incremental updates. Be careful when using the **Complete** mode because you may accidentally delete resources. When you set the mode to **Complete**, Resource Manager deletes any resources in the resource group that aren't in the template.
0 commit comments