Skip to content

Commit 068c74a

Browse files
Merge pull request #101306 from mumian/0115-order-create
order the properties
2 parents bb584f2 + bac0438 commit 068c74a

12 files changed

+786
-788
lines changed

articles/azure-resource-manager/templates/child-resource-name-type.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ The following example shows a virtual network and with a subnet. Notice that the
5050
```json
5151
"resources": [
5252
{
53-
"apiVersion": "2018-10-01",
5453
"type": "Microsoft.Network/virtualNetworks",
54+
"apiVersion": "2018-10-01",
5555
"name": "VNet1",
5656
"location": "[parameters('location')]",
5757
"properties": {
@@ -63,10 +63,10 @@ The following example shows a virtual network and with a subnet. Notice that the
6363
},
6464
"resources": [
6565
{
66-
"apiVersion": "2018-10-01",
6766
"type": "subnets",
68-
"location": "[parameters('location')]",
67+
"apiVersion": "2018-10-01",
6968
"name": "Subnet1",
69+
"location": "[parameters('location')]",
7070
"dependsOn": [
7171
"VNet1"
7272
],
@@ -97,8 +97,8 @@ The following example shows a virtual network and subnet that are both defined a
9797
```json
9898
"resources": [
9999
{
100-
"apiVersion": "2018-10-01",
101100
"type": "Microsoft.Network/virtualNetworks",
101+
"apiVersion": "2018-10-01",
102102
"name": "VNet1",
103103
"location": "[parameters('location')]",
104104
"properties": {
@@ -110,8 +110,8 @@ The following example shows a virtual network and subnet that are both defined a
110110
}
111111
},
112112
{
113-
"apiVersion": "2018-10-01",
114113
"type": "Microsoft.Network/virtualNetworks/subnets",
114+
"apiVersion": "2018-10-01",
115115
"location": "[parameters('location')]",
116116
"name": "VNet1/Subnet1",
117117
"dependsOn": [
@@ -126,6 +126,6 @@ The following example shows a virtual network and subnet that are both defined a
126126

127127
## Next steps
128128

129-
* To learn about creating Azure Resource Manager templates, see [Authoring templates](template-syntax.md).
129+
* To learn about creating Azure Resource Manager templates, see [Authoring templates](template-syntax.md).
130130

131131
* To learn about the format of the resource name when referencing the resource, see the [reference function](template-functions-resource.md#reference).

articles/azure-resource-manager/templates/conditional-resource-deployment.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ You can use conditional deployment to create a new resource or use an existing o
1515

1616
```json
1717
{
18-
"condition": "[equals(parameters('newOrExisting'),'new')]",
19-
"type": "Microsoft.Storage/storageAccounts",
20-
"name": "[variables('storageAccountName')]",
21-
"apiVersion": "2017-06-01",
22-
"location": "[parameters('location')]",
23-
"sku": {
24-
"name": "[variables('storageAccountType')]"
25-
},
26-
"kind": "Storage",
27-
"properties": {}
18+
"condition": "[equals(parameters('newOrExisting'),'new')]",
19+
"type": "Microsoft.Storage/storageAccounts",
20+
"apiVersion": "2017-06-01",
21+
"name": "[variables('storageAccountName')]",
22+
"location": "[parameters('location')]",
23+
"sku": {
24+
"name": "[variables('storageAccountType')]"
25+
},
26+
"kind": "Storage",
27+
"properties": {}
2828
}
2929
```
3030

@@ -38,31 +38,31 @@ You can pass in a parameter value that indicates whether a condition is allowed.
3838

3939
```json
4040
{
41-
"type": "Microsoft.Sql/servers",
42-
"name": "[parameters('serverName')]",
43-
"apiVersion": "2015-05-01-preview",
44-
"location": "[parameters('location')]",
45-
"properties": {
46-
"administratorLogin": "[parameters('administratorLogin')]",
47-
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
48-
"version": "12.0"
49-
},
50-
"resources": [
51-
{
52-
"condition": "[parameters('allowAzureIPs')]",
53-
"type": "firewallRules",
54-
"name": "AllowAllWindowsAzureIps",
55-
"apiVersion": "2015-05-01-preview",
56-
"location": "[parameters('location')]",
57-
"dependsOn": [
58-
"[resourceId('Microsoft.Sql/servers/', parameters('serverName'))]"
59-
],
60-
"properties": {
61-
"endIpAddress": "0.0.0.0",
62-
"startIpAddress": "0.0.0.0"
63-
}
64-
}
65-
]
41+
"type": "Microsoft.Sql/servers",
42+
"apiVersion": "2015-05-01-preview",
43+
"name": "[parameters('serverName')]",
44+
"location": "[parameters('location')]",
45+
"properties": {
46+
"administratorLogin": "[parameters('administratorLogin')]",
47+
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
48+
"version": "12.0"
49+
},
50+
"resources": [
51+
{
52+
"condition": "[parameters('allowAzureIPs')]",
53+
"type": "firewallRules",
54+
"apiVersion": "2015-05-01-preview",
55+
"name": "AllowAllWindowsAzureIps",
56+
"location": "[parameters('location')]",
57+
"dependsOn": [
58+
"[resourceId('Microsoft.Sql/servers/', parameters('serverName'))]"
59+
],
60+
"properties": {
61+
"endIpAddress": "0.0.0.0",
62+
"startIpAddress": "0.0.0.0"
63+
}
64+
}
65+
]
6666
}
6767
```
6868

articles/azure-resource-manager/templates/create-multiple-instances.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ When used with a resource, the copy object has the following format:
1212

1313
```json
1414
"copy": {
15-
"name": "<name-of-loop>",
16-
"count": <number-of-iterations>,
17-
"mode": "serial" <or> "parallel",
18-
"batchSize": <number-to-deploy-serially>
15+
"name": "<name-of-loop>",
16+
"count": <number-of-iterations>,
17+
"mode": "serial" <or> "parallel",
18+
"batchSize": <number-to-deploy-serially>
1919
}
2020
```
2121

@@ -24,9 +24,9 @@ When used with a variable or property, the copy object has the following format:
2424
```json
2525
"copy": [
2626
{
27-
"name": "<name-of-loop>",
28-
"count": <number-of-iterations>,
29-
"input": <values-for-the-property-or-variable>
27+
"name": "<name-of-loop>",
28+
"count": <number-of-iterations>,
29+
"input": <values-for-the-property-or-variable>
3030
}
3131
]
3232
```
@@ -57,19 +57,19 @@ The resource to create several times takes the following format:
5757
"contentVersion": "1.0.0.0",
5858
"resources": [
5959
{
60-
"apiVersion": "2016-01-01",
6160
"type": "Microsoft.Storage/storageAccounts",
61+
"apiVersion": "2016-01-01",
6262
"name": "[concat(copyIndex(),'storage', uniqueString(resourceGroup().id))]",
6363
"location": "[resourceGroup().location]",
6464
"sku": {
6565
"name": "Standard_LRS"
6666
},
6767
"kind": "Storage",
68-
"properties": {},
6968
"copy": {
7069
"name": "storagecopy",
7170
"count": 3
72-
}
71+
},
72+
"properties": {}
7373
}
7474
],
7575
"outputs": {}
@@ -143,21 +143,21 @@ For example, to serially deploy storage accounts two at a time, use:
143143
"contentVersion": "1.0.0.0",
144144
"resources": [
145145
{
146-
"apiVersion": "2016-01-01",
147146
"type": "Microsoft.Storage/storageAccounts",
147+
"apiVersion": "2016-01-01",
148148
"name": "[concat(copyIndex(),'storage', uniqueString(resourceGroup().id))]",
149149
"location": "[resourceGroup().location]",
150150
"sku": {
151151
"name": "Standard_LRS"
152152
},
153153
"kind": "Storage",
154-
"properties": {},
155154
"copy": {
156155
"name": "storagecopy",
157156
"count": 4,
158157
"mode": "serial",
159158
"batchSize": 2
160-
}
159+
},
160+
"properties": {}
161161
}
162162
],
163163
"outputs": {}
@@ -180,9 +180,9 @@ The following example shows how to apply `copy` to the dataDisks property on a v
180180

181181
```json
182182
{
183-
"name": "examplevm",
184183
"type": "Microsoft.Compute/virtualMachines",
185184
"apiVersion": "2017-03-30",
185+
"name": "examplevm",
186186
"properties": {
187187
"storageProfile": {
188188
"copy": [{
@@ -261,8 +261,8 @@ You can use resource and property iteration together. Reference the property ite
261261
```json
262262
{
263263
"type": "Microsoft.Network/virtualNetworks",
264-
"name": "[concat(parameters('vnetname'), copyIndex())]",
265264
"apiVersion": "2018-04-01",
265+
"name": "[concat(parameters('vnetname'), copyIndex())]",
266266
"copy":{
267267
"count": 2,
268268
"name": "vnetloop"
@@ -425,23 +425,23 @@ You specify that a resource is deployed after another resource by using the `dep
425425
"parameters": {},
426426
"resources": [
427427
{
428-
"apiVersion": "2016-01-01",
429428
"type": "Microsoft.Storage/storageAccounts",
429+
"apiVersion": "2016-01-01",
430430
"name": "[concat(copyIndex(),'storage', uniqueString(resourceGroup().id))]",
431431
"location": "[resourceGroup().location]",
432432
"sku": {
433433
"name": "Standard_LRS"
434434
},
435435
"kind": "Storage",
436-
"properties": {},
437436
"copy": {
438437
"name": "storagecopy",
439438
"count": 3
440-
}
439+
},
440+
"properties": {}
441441
},
442442
{
443-
"apiVersion": "2015-06-15",
444443
"type": "Microsoft.Compute/virtualMachines",
444+
"apiVersion": "2015-06-15",
445445
"name": "[concat('VM', uniqueString(resourceGroup().id))]",
446446
"dependsOn": ["storagecopy"],
447447
...

articles/azure-resource-manager/templates/define-resource-dependency.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ The following example shows a virtual machine scale set that depends on a load b
1919
```json
2020
{
2121
"type": "Microsoft.Compute/virtualMachineScaleSets",
22+
"apiVersion": "2016-03-30",
2223
"name": "[variables('namingInfix')]",
2324
"location": "[variables('location')]",
24-
"apiVersion": "2016-03-30",
2525
"tags": {
2626
"displayName": "VMScaleSet"
2727
},
@@ -59,28 +59,28 @@ The following example shows a SQL server and SQL database. Notice that an explic
5959
"resources": [
6060
{
6161
"name": "[variables('sqlserverName')]",
62+
"apiVersion": "2014-04-01-preview",
6263
"type": "Microsoft.Sql/servers",
6364
"location": "[resourceGroup().location]",
6465
"tags": {
6566
"displayName": "SqlServer"
6667
},
67-
"apiVersion": "2014-04-01-preview",
6868
"properties": {
6969
"administratorLogin": "[parameters('administratorLogin')]",
7070
"administratorLoginPassword": "[parameters('administratorLoginPassword')]"
7171
},
7272
"resources": [
7373
{
7474
"name": "[parameters('databaseName')]",
75+
"apiVersion": "2014-04-01-preview",
7576
"type": "databases",
7677
"location": "[resourceGroup().location]",
77-
"tags": {
78-
"displayName": "Database"
79-
},
80-
"apiVersion": "2014-04-01-preview",
8178
"dependsOn": [
8279
"[variables('sqlserverName')]"
8380
],
81+
"tags": {
82+
"displayName": "Database"
83+
},
8484
"properties": {
8585
"edition": "[parameters('edition')]",
8686
"collation": "[parameters('collation')]",
@@ -114,15 +114,15 @@ In the following example, a CDN endpoint explicitly depends on the CDN profile,
114114
```json
115115
{
116116
"name": "[variables('endpointName')]",
117+
"apiVersion": "2016-04-02",
117118
"type": "endpoints",
118119
"location": "[resourceGroup().location]",
119-
"apiVersion": "2016-04-02",
120120
"dependsOn": [
121-
"[variables('profileName')]"
121+
"[variables('profileName')]"
122122
],
123123
"properties": {
124-
"originHostHeader": "[reference(variables('webAppName')).hostNames[0]]",
125-
...
124+
"originHostHeader": "[reference(variables('webAppName')).hostNames[0]]",
125+
...
126126
}
127127
```
128128

@@ -146,6 +146,6 @@ For information about assessing the deployment order and resolving dependency er
146146
* To go through a tutorial, see [Tutorial: create Azure Resource Manager templates with dependent resources](template-tutorial-create-templates-with-dependent-resources.md).
147147
* For recommendations when setting dependencies, see [Azure Resource Manager template best practices](template-best-practices.md).
148148
* To learn about troubleshooting dependencies during deployment, see [Troubleshoot common Azure deployment errors with Azure Resource Manager](common-deployment-errors.md).
149-
* To learn about creating Azure Resource Manager templates, see [Authoring templates](template-syntax.md).
149+
* To learn about creating Azure Resource Manager templates, see [Authoring templates](template-syntax.md).
150150
* For a list of the available functions in a template, see [Template functions](template-functions.md).
151151

0 commit comments

Comments
 (0)