Skip to content

Commit 961a436

Browse files
committed
update error messages
1 parent a37f618 commit 961a436

10 files changed

+71
-85
lines changed
1.45 KB
Loading
29.5 KB
Loading

articles/azure-resource-manager/resource-manager-deployment-operations.md

Lines changed: 71 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For help with resolving particular deployment errors, see [Resolve common errors
1313

1414
## Get deployments and correlation ID
1515

16-
To get details about a deployment from the deployment history use portal, PowerShell, Azure CLI, or REST API.
16+
You can view details about a deployment through the Azure portal, PowerShell, Azure CLI, or REST API. Each deployment has a correlation ID, which is used to track related events. It can be helpful when working with technical support to troubleshoot a deployment.
1717

1818
# [Portal](#tab/azure-portal)
1919

@@ -27,7 +27,7 @@ To get details about a deployment from the deployment history use portal, PowerS
2727

2828
![Select deployment](./media/resource-manager-deployment-operations/select-details.png)
2929

30-
1. A summary of the deployment is displayed, including the correlation ID. The correlation ID is used to track related events, and can be helpful when working with technical support to troubleshoot a deployment.
30+
1. A summary of the deployment is displayed, including the correlation ID.
3131

3232
![Deployment summary](./media/resource-manager-deployment-operations/show-correlation-id.png)
3333

@@ -45,7 +45,7 @@ To get a specific deployment from a resource group, add the **DeploymentName** p
4545
Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment
4646
```
4747

48-
The correlation ID is used to track related events. It can be helpful when working with technical support to troubleshoot a deployment. To get the correlation ID, use:
48+
To get the correlation ID, use:
4949

5050
```azurepowershell-interactive
5151
(Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment).CorrelationId
@@ -65,155 +65,141 @@ To get a specific deployment, use the [azure group deployment show](/cli/azure/g
6565
az group deployment show --resource-group ExampleGroup --name ExampleDeployment
6666
```
6767

68-
The correlation ID is used to track related events. It can be helpful when working with technical support to troubleshoot a deployment. To get the correlation ID, use:
68+
To get the correlation ID, use:
6969

7070
```azurecli-interactive
7171
az group deployment show --resource-group ExampleGroup --name ExampleDeployment --query properties.correlationId
7272
```
7373

7474
# [HTTP](#tab/http)
7575

76-
To list the deployments for a resource group, use the [Deployments - List By Resource Group](/rest/api/resources/deployments/listbyresourcegroup) operation.
76+
To list the deployments for a resource group, use the following operation. For the latest API version number to use in the request, see [Deployments - List By Resource Group](/rest/api/resources/deployments/listbyresourcegroup).
7777

7878
```
7979
GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/?api-version={api-version}
8080
```
8181

82-
To get a specific deployment. use the [Deployments - Get](/rest/api/resources/deployments/get) operation.
82+
To get a specific deployment. use the following operation. For the latest API version number to use in the request, see [Deployments - Get](/rest/api/resources/deployments/get).
8383

8484
```
8585
GET https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/microsoft.resources/deployments/{deployment-name}?api-version={api-version}
8686
```
8787

88-
The response includes the correlation ID, which is used to track related events. It can be helpful when working with technical support to troubleshoot a deployment.
88+
The response includes the correlation ID.
8989

9090
```json
91-
{
91+
{
9292
...
9393
"properties": {
94-
"provisioningState":"Failed",
95-
"correlationId":"d5062e45-6e9f-4fd3-a0a0-6b2c56b15757",
94+
"mode": "Incremental",
95+
"provisioningState": "Failed",
96+
"timestamp": "2019-11-26T14:18:36.4518358Z",
97+
"duration": "PT26.2091817S",
98+
"correlationId": "47ff4228-bf2e-4ee5-a008-0b07da681230",
9699
...
97-
"error":{
98-
"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.",
99-
"details":[{"code":"Conflict","message":"{\r\n \"error\": {\r\n \"message\": \"Conflict\",\r\n \"code\": \"Conflict\"\r\n }\r\n}"}]
100-
}
101100
}
102101
}
103102
```
104103

105104
---
106105

107-
## Get deployment operations
106+
## Get deployment operations and error message
108107

109-
To get details about a deployment from the deployment history use portal, PowerShell, Azure CLI, or REST API.
108+
Each deployment can include multiple operations. Each operation represents a step in the deployment process. To see more details about a deployment, view the deployment operations. When a deployment fails, the deployment operations include an error message.
110109

111110
# [Portal](#tab/azure-portal)
112111

113112
1. On the summary for a deployment, select **Operation details**.
114113

115114
![Select deployment operations](./media/resource-manager-deployment-operations/get-operation-details.png)
116115

117-
1. You see the details for that step of the deployment.
116+
1. You see the details for that step of the deployment. When an error occurs, the details include the error message.
118117

119118
![Show operation details](./media/resource-manager-deployment-operations/see-operation-details.png)
120119

121120
# [PowerShell](#tab/azure-powershell)
122121

123-
Each deployment includes multiple operations. Each operation represents a step in the deployment process. To discover what went wrong with a deployment, you usually need to see details about the deployment operations. You can see the status of the operations with **Get-AzResourceGroupDeploymentOperation**.
122+
To view the deployment operations for deployment to a resource group, use the [Get-AzResourceGroupDeploymentOperation](/powershell/module/az.resources/get-azdeploymentoperation) command.
124123

125124
```azurepowershell-interactive
126-
Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName azuredeploy
125+
Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName ExampleDeploy
127126
```
128127

129-
# [Azure CLI](#tab/azure-cli)
130-
131-
To see the operations for a deployment, use:
128+
To view failed operations, filter operations with **Failed** state.
132129

133-
```azurecli-interactive
134-
az group deployment operation list -g ExampleGroup -n ExampleDeployment
130+
```azurepowershell-interactive
131+
(Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName ExampleDeploy).Properties | Where-Object ProvisioningState -eq Failed
135132
```
136133

137-
# [HTTP](#tab/http)
138-
139-
The following example shows how to get deployment operations. For documentation about the latest API version, see the [Deployment Operations - List](/rest/api/resources/deploymentoperations/list) operation.
140-
141-
```
142-
GET https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/microsoft.resources/deployments/{deployment-name}/operations?$skiptoken={skiptoken}&api-version={api-version}
143-
```
144-
145-
The response includes request and/or response information based on what you specified in the **debugSetting** property during deployment.
134+
To get the status message of failed operations, use the following command:
146135

147-
```json
148-
{
149-
...
150-
"properties":
151-
{
152-
...
153-
"request":{
154-
"content":{
155-
"location":"West US",
156-
"properties":{
157-
"accountType": "Standard_LRS"
158-
}
159-
}
160-
},
161-
"response":{
162-
"content":{
163-
"error":{
164-
"message":"Conflict","code":"Conflict"
165-
}
166-
}
167-
}
168-
}
169-
}
136+
```azurepowershell-interactive
137+
((Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName ExampleDeploy ).Properties | Where-Object ProvisioningState -eq Failed).StatusMessage.error
170138
```
171139

172-
---
173-
174-
175-
## PowerShell
140+
# [Azure CLI](#tab/azure-cli)
176141

142+
To view the deployment operations for deployment to a resource group, use the [az group deployment operation list](/cli/azure/group/deployment/operation) command.
177143

144+
```azurecli-interactive
145+
az group deployment operation list --resource-group ExampleGroup --name ExampleDeployment
146+
```
178147

179-
To get more details about failed operations, retrieve the properties for operations with **Failed** state.
148+
To view failed operations, filter operations with **Failed** state.
180149

181-
```azurepowershell-interactive
182-
(Get-AzResourceGroupDeploymentOperation -DeploymentName azuredeploy -ResourceGroupName ExampleGroup).Properties | Where-Object ProvisioningState -eq Failed
150+
```azurecli-interactive
151+
az group deployment operation list --resource-group ExampleGroup --name ExampleDeploy --query "[?properties.provisioningState=='Failed']"
183152
```
184153

185-
Which returns all the failed operations with each one in the following format:
154+
To get the status message of failed operations, use the following command:
186155

187-
```powershell
188-
provisioningOperation : Create
189-
provisioningState : Failed
190-
timestamp : 2019-05-13T21:42:40.7151512Z
191-
duration : PT3.1449887S
192-
trackingId : f4ed72f8-4203-43dc-958a-15d041e8c233
193-
serviceRequestId : a426f689-5d5a-448d-a2f0-9784d14c900a
194-
statusCode : BadRequest
195-
statusMessage : @{error=}
196-
targetResource : @{id=/subscriptions/{guid}/resourceGroups/ExampleGroup/providers/
197-
Microsoft.Network/publicIPAddresses/myPublicIP;
198-
resourceType=Microsoft.Network/publicIPAddresses; resourceName=myPublicIP}
156+
```azurecli-interactive
157+
az group deployment operation list --resource-group ExampleGroup --name ExampleDeploy --query "[?properties.provisioningState=='Failed'].properties.statusMessage.error"
199158
```
200159

201-
Note the serviceRequestId and the trackingId for the operation. The serviceRequestId can be helpful when working with technical support to troubleshoot a deployment. You'll use the trackingId in the next step to focus on a particular operation.
160+
# [HTTP](#tab/http)
202161

203-
To get the status message of a particular failed operation, use the following command:
162+
To get deployment operations, use the following operation. For the latest API version number to use in the request, see [Deployment Operations - List](/rest/api/resources/deploymentoperations/list).
204163

205-
```azurepowershell-interactive
206-
((Get-AzResourceGroupDeploymentOperation -DeploymentName azuredeploy -ResourceGroupName ExampleGroup).Properties | Where-Object trackingId -eq f4ed72f8-4203-43dc-958a-15d041e8c233).StatusMessage.error
164+
```
165+
GET https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/microsoft.resources/deployments/{deployment-name}/operations?$skiptoken={skiptoken}&api-version={api-version}
207166
```
208167

209-
Which returns:
168+
The response includes an error message.
210169

211-
```powershell
212-
code message details
213-
---- ------- -------
214-
DnsRecordInUse DNS record dns.westus.cloudapp.azure.com is already used by another public IP. {}
170+
```json
171+
{
172+
"value": [
173+
{
174+
"id": "/subscriptions/xxxx/resourceGroups/examplegroup/providers/Microsoft.Resources/deployments/exampledeploy/operations/13EFD9907103D640",
175+
"operationId": "13EFD9907103D640",
176+
"properties": {
177+
"provisioningOperation": "Create",
178+
"provisioningState": "Failed",
179+
"timestamp": "2019-11-26T14:18:36.3177613Z",
180+
"duration": "PT21.0580179S",
181+
"trackingId": "9d3cdac4-54f8-486c-94bd-10c20867b8bc",
182+
"serviceRequestId": "01a9d0fe-896b-4c94-a30f-60b70a8f1ad9",
183+
"statusCode": "BadRequest",
184+
"statusMessage": {
185+
"error": {
186+
"code": "InvalidAccountType",
187+
"message": "The AccountType Standard_LRS1 is invalid. For more information, see - https://aka.ms/storageaccountskus"
188+
}
189+
},
190+
"targetResource": {
191+
"id": "/subscriptions/xxxx/resourceGroups/examplegroup/providers/Microsoft.Storage/storageAccounts/storageq2czadzfgizc2",
192+
"resourceType": "Microsoft.Storage/storageAccounts",
193+
"resourceName": "storageq2czadzfgizc2"
194+
}
195+
}
196+
},
197+
...
198+
]
199+
}
215200
```
216201

202+
---
217203

218204
## Next steps
219205

0 commit comments

Comments
 (0)