Skip to content

Commit b4b58ce

Browse files
authored
Merge pull request #101421 from mumian/0116-order-troubleshoot
order the properties
2 parents 6b61653 + 777b18f commit b4b58ce

File tree

5 files changed

+75
-76
lines changed

5 files changed

+75
-76
lines changed

articles/azure-resource-manager/templates/common-deployment-errors.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,19 @@ To log debug information for a nested template, use the **debugSetting** element
195195

196196
```json
197197
{
198-
"apiVersion": "2016-09-01",
199-
"name": "nestedTemplate",
200-
"type": "Microsoft.Resources/deployments",
201-
"properties": {
202-
"mode": "Incremental",
203-
"templateLink": {
204-
"uri": "{template-uri}",
205-
"contentVersion": "1.0.0.0"
206-
},
207-
"debugSetting": {
208-
"detailLevel": "requestContent, responseContent"
209-
}
198+
"type": "Microsoft.Resources/deployments",
199+
"apiVersion": "2016-09-01",
200+
"name": "nestedTemplate",
201+
"properties": {
202+
"mode": "Incremental",
203+
"templateLink": {
204+
"uri": "{template-uri}",
205+
"contentVersion": "1.0.0.0"
206+
},
207+
"debugSetting": {
208+
"detailLevel": "requestContent, responseContent"
210209
}
210+
}
211211
}
212212
```
213213

@@ -220,27 +220,26 @@ In some cases, the easiest way to troubleshoot your template is to test parts of
220220
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
221221
"contentVersion": "1.0.0.0",
222222
"parameters": {
223-
"storageName": {
224-
"type": "string"
225-
},
226-
"storageResourceGroup": {
227-
"type": "string"
228-
}
223+
"storageName": {
224+
"type": "string"
225+
},
226+
"storageResourceGroup": {
227+
"type": "string"
228+
}
229229
},
230230
"variables": {},
231231
"resources": [],
232232
"outputs": {
233-
"exampleOutput": {
234-
"value": "[reference(resourceId(parameters('storageResourceGroup'), 'Microsoft.Storage/storageAccounts', parameters('storageName')), '2016-05-01')]",
235-
"type" : "object"
236-
}
233+
"exampleOutput": {
234+
"value": "[reference(resourceId(parameters('storageResourceGroup'), 'Microsoft.Storage/storageAccounts', parameters('storageName')), '2016-05-01')]",
235+
"type" : "object"
236+
}
237237
}
238238
}
239239
```
240240

241241
Or, suppose you're getting deployment errors that you believe are related to incorrectly set dependencies. Test your template by breaking it into simplified templates. First, create a template that deploys only a single resource (like a SQL Server). When you're sure you have that resource correctly defined, add a resource that depends on it (like a SQL Database). When you have those two resources correctly defined, add other dependent resources (like auditing policies). In between each test deployment, delete the resource group to make sure you adequately testing the dependencies.
242242

243-
244243
## Next steps
245244

246245
* To go through a troubleshooting tutorial, see [Tutorial: Troubleshoot Resource Manager template deployments](template-tutorial-troubleshoot.md)

articles/azure-resource-manager/templates/error-invalid-template.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,28 @@ For child resources, the type and name have the same number of segments. This nu
8080

8181
```json
8282
"resources": [
83-
{
84-
"type": "Microsoft.KeyVault/vaults",
85-
"name": "contosokeyvault",
83+
{
84+
"type": "Microsoft.KeyVault/vaults",
85+
"name": "contosokeyvault",
86+
...
87+
"resources": [
88+
{
89+
"type": "secrets",
90+
"name": "appPassword",
8691
...
87-
"resources": [
88-
{
89-
"type": "secrets",
90-
"name": "appPassword",
91-
...
92-
}
93-
]
94-
}
92+
}
93+
]
94+
}
9595
]
9696
```
9797

9898
Getting the segments right can be tricky with Resource Manager types that are applied across resource providers. For example, applying a resource lock to a web site requires a type with four segments. Therefore, the name is three segments:
9999

100100
```json
101101
{
102-
"type": "Microsoft.Web/sites/providers/locks",
103-
"name": "[concat(variables('siteName'),'/Microsoft.Authorization/MySiteLock')]",
104-
...
102+
"type": "Microsoft.Web/sites/providers/locks",
103+
"name": "[concat(variables('siteName'),'/Microsoft.Authorization/MySiteLock')]",
104+
...
105105
}
106106
```
107107

@@ -134,13 +134,13 @@ You receive this error when resources depend on each other in a way that prevent
134134

135135
To solve a circular dependency:
136136

137-
1. In your template, find the resource identified in the circular dependency.
138-
2. For that resource, examine the **dependsOn** property and any uses of the **reference** function to see which resources it depends on.
137+
1. In your template, find the resource identified in the circular dependency.
138+
2. For that resource, examine the **dependsOn** property and any uses of the **reference** function to see which resources it depends on.
139139
3. Examine those resources to see which resources they depend on. Follow the dependencies until you notice a resource that depends on the original resource.
140-
5. For the resources involved in the circular dependency, carefully examine all uses of the **dependsOn** property to identify any dependencies that are not needed. Remove those dependencies. If you are unsure that a dependency is needed, try removing it.
140+
5. For the resources involved in the circular dependency, carefully examine all uses of the **dependsOn** property to identify any dependencies that are not needed. Remove those dependencies. If you are unsure that a dependency is needed, try removing it.
141141
6. Redeploy the template.
142142

143-
Removing values from the **dependsOn** property can cause errors when you deploy the template. If you get an error, add the dependency back into the template.
143+
Removing values from the **dependsOn** property can cause errors when you deploy the template. If you get an error, add the dependency back into the template.
144144

145145
If that approach doesn't solve the circular dependency, consider moving part of your deployment logic into child resources (such as extensions or configuration settings). Configure those child resources to deploy after the resources involved in the circular dependency. For example, suppose you're deploying two virtual machines but you must set properties on each one that refer to the other. You can deploy them in the following order:
146146

articles/azure-resource-manager/templates/error-not-found.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ If you're trying to deploy the missing resource in the template, check whether y
3535

3636
```json
3737
{
38-
"apiVersion": "2015-08-01",
3938
"type": "Microsoft.Web/sites",
39+
"apiVersion": "2015-08-01",
4040
"dependsOn": [
4141
"[variables('hostingPlanName')]"
4242
],
@@ -70,8 +70,8 @@ When the resource exists in a different resource group than the one being deploy
7070

7171
```json
7272
"properties": {
73-
"name": "[parameters('siteName')]",
74-
"serverFarmId": "[resourceId('plangroup', 'Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
73+
"name": "[parameters('siteName')]",
74+
"serverFarmId": "[resourceId('plangroup', 'Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
7575
}
7676
```
7777

articles/azure-resource-manager/templates/error-parent-resource.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ When one resource is a child to another resource, the parent resource must exist
2828
...
2929
```
3030

31-
If you deploy both the server and the database in the same template, but don't specify a dependency on the server, the database deployment might start before the server has deployed.
31+
If you deploy both the server and the database in the same template, but don't specify a dependency on the server, the database deployment might start before the server has deployed.
3232

3333
If the parent resource already exists and isn't deployed in the same template, you get this error when Resource Manager can't associate the child resource with parent. This error might happen when the child resource isn't in the correct format, or the child resource is deployed to a resource group that is different than the resource group for parent resource.
3434

@@ -38,37 +38,37 @@ To resolve this error when parent and child resources are deployed in the same t
3838

3939
```json
4040
"dependsOn": [
41-
"[variables('databaseServerName')]"
41+
"[variables('databaseServerName')]"
4242
]
4343
```
4444

4545
To resolve this error when the parent resource was previously deployed in a different template, you don't set a dependency. Instead, deploy the child to the same resource group and provide the name of the parent resource.
4646

4747
```json
4848
{
49-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
50-
"contentVersion": "1.0.0.0",
51-
"parameters": {
52-
"sqlServerName": {
53-
"type": "string"
54-
},
55-
"databaseName": {
56-
"type": "string"
57-
}
49+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
50+
"contentVersion": "1.0.0.0",
51+
"parameters": {
52+
"sqlServerName": {
53+
"type": "string"
5854
},
59-
"resources": [
60-
{
61-
"apiVersion": "2014-04-01",
62-
"type": "Microsoft.Sql/servers/databases",
63-
"location": "[resourceGroup().location]",
64-
"name": "[concat(parameters('sqlServerName'), '/', parameters('databaseName'))]",
65-
"properties": {
66-
"collation": "SQL_Latin1_General_CP1_CI_AS",
67-
"edition": "Basic"
68-
}
69-
}
70-
],
71-
"outputs": {}
55+
"databaseName": {
56+
"type": "string"
57+
}
58+
},
59+
"resources": [
60+
{
61+
"type": "Microsoft.Sql/servers/databases",
62+
"apiVersion": "2014-04-01",
63+
"name": "[concat(parameters('sqlServerName'), '/', parameters('databaseName'))]",
64+
"location": "[resourceGroup().location]",
65+
"properties": {
66+
"collation": "SQL_Latin1_General_CP1_CI_AS",
67+
"edition": "Basic"
68+
}
69+
}
70+
],
71+
"outputs": {}
7272
}
7373
```
7474

articles/azure-resource-manager/templates/error-storage-account-name.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If your storage account name includes prohibited characters, you receive an erro
1414

1515
```
1616
Code=AccountNameInvalid
17-
Message=S!torageckrexph7isnoc is not a valid storage account name. Storage account name must be
17+
Message=S!torageckrexph7isnoc is not a valid storage account name. Storage account name must be
1818
between 3 and 24 characters in length and use numbers and lower-case letters only.
1919
```
2020

@@ -44,14 +44,14 @@ Make sure your storage account name does not exceed 24 characters. The [uniqueSt
4444

4545
```json
4646
"parameters": {
47-
"storageNamePrefix": {
48-
"type": "string",
49-
"maxLength": 11,
50-
"defaultValue": "storage",
51-
"metadata": {
52-
"description": "The value to use for starting the storage account name."
53-
}
47+
"storageNamePrefix": {
48+
"type": "string",
49+
"maxLength": 11,
50+
"defaultValue": "storage",
51+
"metadata": {
52+
"description": "The value to use for starting the storage account name."
5453
}
54+
}
5555
}
5656
```
5757

0 commit comments

Comments
 (0)