Skip to content

Commit 7fc633b

Browse files
committed
Fixes
1 parent 713a4bd commit 7fc633b

File tree

1 file changed

+36
-27
lines changed

1 file changed

+36
-27
lines changed

articles/virtual-machine-scale-sets/virtual-machine-scale-sets-mvss-start.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ First, define `$schema` and `contentVersion` in the template. The `$schema` elem
2626
{
2727
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
2828
"contentVersion": "1.0.0.0",
29+
}
2930
```
3031

3132
## Define parameters
33+
3234
Next, define two parameters, `adminUsername` and `adminPassword`. Parameters are values you specify at the time of deployment. The `adminUsername` parameter is simply a `string` type, but because `adminPassword` is a secret, give it type `securestring`. Later, these parameters are passed into the scale set configuration.
3335

3436
```json
@@ -41,7 +43,9 @@ Next, define two parameters, `adminUsername` and `adminPassword`. Parameters are
4143
}
4244
},
4345
```
46+
4447
## Define variables
48+
4549
Resource Manager templates also let you define variables to be used later in the template. The example doesn't use any variables, so the JSON object is empty.
4650

4751
```json
@@ -52,7 +56,9 @@ Resource Manager templates also let you define variables to be used later in the
5256
Next is the resources section of the template. Here, you define what you actually want to deploy. Unlike `parameters` and `variables` (which are JSON objects), `resources` is a JSON list of JSON objects.
5357

5458
```json
55-
"resources": [
59+
"resources": [
60+
...
61+
]
5662
```
5763

5864
All resources require `type`, `name`, `apiVersion`, and `location` properties. This example's first resource has type [Microsoft.Network/virtualNetwork](/azure/templates/microsoft.network/virtualnetworks), name `myVnet`, and apiVersion `2018-11-01`. (To find the latest API version for a resource type, see the [Azure Resource Manager template reference](/azure/templates/).)
@@ -66,13 +72,15 @@ All resources require `type`, `name`, `apiVersion`, and `location` properties. T
6672
```
6773

6874
## Specify location
75+
6976
To specify the location for the virtual network, use a [Resource Manager template function](../azure-resource-manager/templates/template-functions.md). This function must be enclosed in quotes and square brackets like this: `"[<template-function>]"`. In this case, use the `resourceGroup` function. It takes in no arguments and returns a JSON object with metadata about the resource group this deployment is being deployed to. The resource group is set by the user at the time of deployment. This value is then indexed into this JSON object with `.location` to get the location from the JSON object.
7077

7178
```json
7279
"location": "[resourceGroup().location]",
7380
```
7481

7582
## Specify virtual network properties
83+
7684
Each Resource Manager resource has its own `properties` section for configurations specific to the resource. In this case, specify that the virtual network should have one subnet using the private IP address range `10.0.0.0/16`. A scale set is always contained within one subnet. It cannot span subnets.
7785

7886
```json
@@ -96,6 +104,7 @@ Each Resource Manager resource has its own `properties` section for configuratio
96104
```
97105

98106
## Add dependsOn list
107+
99108
In addition to the required `type`, `name`, `apiVersion`, and `location` properties, each resource can have an optional `dependsOn` list of strings. This list specifies which other resources from this deployment must finish before deploying this resource.
100109

101110
In this case, there is only one element in the list, the virtual network from the previous example. You specify this dependency because the scale set needs the network to exist before creating any VMs. This way, the scale set can give these VMs private IP addresses from the IP address range previously specified in the network properties. The format of each string in the dependsOn list is `<type>/<name>`. Use the same `type` and `name` used previously in the virtual network resource definition.
@@ -116,7 +125,9 @@ In this case, there is only one element in the list, the virtual network from th
116125
## Specify scale set properties
117126

118127
Scale sets have many properties for customizing the VMs in the scale set. For a full list of these properties, see the [template reference](/azure/templates/microsoft.compute/virtualmachinescalesets). For this tutorial, only a few commonly used properties are set.
128+
119129
### Supply VM size and capacity
130+
120131
The scale set needs to know what size of VM to create ("sku name") and how many such VMs to create ("sku capacity"). To see which VM sizes are available, see the [VM Sizes documentation](../virtual-machines/sizes.md).
121132

122133
```json
@@ -127,6 +138,7 @@ The scale set needs to know what size of VM to create ("sku name") and how many
127138
```
128139

129140
### Choose type of updates
141+
130142
The scale set also needs to know how to handle updates on the scale set. Currently, there are three options, `Manual`, `Rolling` and `Automatic`. For more information on the differences between the two, see the documentation on [how to upgrade a scale set](./virtual-machine-scale-sets-upgrade-policy.md).
131143

132144
```json
@@ -138,6 +150,7 @@ The scale set also needs to know how to handle updates on the scale set. Current
138150
```
139151

140152
### Choose VM operating system
153+
141154
The scale set needs to know what operating system to put on the VMs. Here, create the VMs with a fully patched Ubuntu 16.04-LTS image.
142155

143156
```json
@@ -150,9 +163,11 @@ The scale set needs to know what operating system to put on the VMs. Here, creat
150163
"version": "latest"
151164
}
152165
},
166+
}
153167
```
154168

155169
### Specify computerNamePrefix
170+
156171
The scale set deploys multiple VMs. Instead of specifying each VM name, specify `computerNamePrefix`. The scale set appends an index to the prefix for each VM, so VM names have the form `<computerNamePrefix>_<auto-generated-index>`.
157172

158173
In the following snippet, use the parameters from before to set the administrator username and password for all VMs in the scale set. This process uses the `parameters` template function. This function takes in a string that specifies which parameter to refer to and outputs the value for that parameter.
@@ -173,32 +188,26 @@ You can get the ID of the virtual network containing the subnet by using the `re
173188
However, the identifier of the virtual network is not enough. Provide the specific subnet that the scale set VMs should be in. To do this, concatenate `/subnets/mySubnet` to the ID of the virtual network. The result is the fully qualified ID of the subnet. Do this concatenation with the `concat` function, which takes in a series of strings and returns their concatenation.
174189

175190
```json
176-
"networkProfile": {
177-
"networkInterfaceConfigurations": [
178-
{
179-
"name": "myNic",
180-
"properties": {
181-
"primary": "true",
182-
"ipConfigurations": [
183-
{
184-
"name": "myIpConfig",
185-
"properties": {
186-
"subnet": {
187-
"id": "[concat(resourceId('Microsoft.Network/virtualNetworks', 'myVnet'), '/subnets/mySubnet')]"
188-
}
189-
}
190-
}
191-
]
192-
}
193-
}
194-
]
195-
}
196-
}
197-
}
198-
}
199-
]
200-
}
201-
191+
"networkProfile": {
192+
"networkInterfaceConfigurations": [
193+
{
194+
"name": "myNic",
195+
"properties": {
196+
"primary": "true",
197+
"ipConfigurations": [
198+
{
199+
"name": "myIpConfig",
200+
"properties": {
201+
"subnet": {
202+
"id": "[concat(resourceId('Microsoft.Network/virtualNetworks', 'myVnet'), '/subnets/mySubnet')]"
203+
}
204+
}
205+
}
206+
]
207+
}
208+
}
209+
]
210+
}
202211
```
203212

204213
## Next steps

0 commit comments

Comments
 (0)