Skip to content

Commit 5c54eb8

Browse files
committed
update deployment operations
1 parent 0d03392 commit 5c54eb8

File tree

2 files changed

+119
-111
lines changed

2 files changed

+119
-111
lines changed
25.6 KB
Loading

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

Lines changed: 119 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ title: Deployment history
33
description: Describes how to view Azure Resource Manager deployment operations with the portal, PowerShell, Azure CLI, and REST API.
44
tags: top-support-issue
55
ms.topic: conceptual
6-
ms.date: 05/13/2019
6+
ms.date: 11/25/2019
77
---
88
# View deployment history with Azure Resource Manager
99

1010
Azure Resource Manager enables you to view your deployment history and examine specific operations in past deployments. You can see the resources that were deployed, and get information about any errors.
1111

1212
For help with resolving particular deployment errors, see [Resolve common errors when deploying resources to Azure with Azure Resource Manager](resource-manager-common-deployment-errors.md).
1313

14-
## Portal
14+
## Get deployment
15+
16+
To get details about a deployment from the deployment history use portal, PowerShell, Azure CLI, or REST API.
1517

16-
To get details about a deployment from the deployment history.
18+
#### [Browser](#tab/browser)
1719

1820
1. Select the resource group you want to examine.
1921

@@ -25,123 +27,31 @@ To get details about a deployment from the deployment history.
2527

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

28-
1. A summary of the deployment is displayed, including a list of the resources that were deployed.
29-
30-
![Deployment summary](./media/resource-manager-deployment-operations/view-deployment-summary.png)
31-
32-
1. To view the template used for the deployment, select **Template**. You can download the template to reuse it.
33-
34-
![Show template](./media/resource-manager-deployment-operations/show-template-from-history.png)
35-
36-
1. If your deployment failed, you see an error message. Select the error message for more details.
37-
38-
![View failed deployment](./media/resource-manager-deployment-operations/show-error.png)
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.
3931

40-
1. The detailed error message is displayed.
41-
42-
![View error details](./media/resource-manager-deployment-operations/show-details.png)
43-
44-
1. The correlation ID is used to track related events, and can be helpful when working with technical support to troubleshoot a deployment.
45-
46-
![Get correlation ID](./media/resource-manager-deployment-operations/get-correlation-id.png)
47-
48-
1. To learn more about the step that failed, select **Operation details**.
49-
50-
![Select deployment operations](./media/resource-manager-deployment-operations/select-deployment-operations.png)
51-
52-
1. You see the details for that step of the deployment.
53-
54-
![Show operation details](./media/resource-manager-deployment-operations/show-operation-details.png)
55-
56-
## PowerShell
32+
![Deployment summary](./media/resource-manager-deployment-operations/show-correlation-id.png)
5733

58-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
34+
#### [PowerShell](#tab/powershell)
5935

60-
To get the overall status of a deployment, use the **Get-AzResourceGroupDeployment** command.
36+
To list all deployments for a resource group, use the [Get-AzResourceGroupDeployment](/powershell/module/az.resources/Get-AzResourceGroupDeployment) command.
6137

6238
```azurepowershell-interactive
6339
Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup
6440
```
6541

66-
Or, you can filter the results for only those deployments that have failed.
42+
To get one deployment from a resource group, use the **DeploymentName** parameter.
6743

6844
```azurepowershell-interactive
69-
Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup | Where-Object ProvisioningState -eq Failed
70-
```
71-
72-
The correlation ID is used to track related events, and can be helpful when working with technical support to troubleshoot a deployment. To get the correlation ID, use:
73-
74-
```azurepowershell-interactive
75-
(Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName azuredeploy).CorrelationId
76-
```
77-
78-
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**.
79-
80-
```azurepowershell-interactive
81-
Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName azuredeploy
82-
```
83-
84-
Which returns multiple operations with each one in the following format:
85-
86-
```powershell
87-
Id : /subscriptions/{guid}/resourceGroups/ExampleGroup/providers/Microsoft.Resources/deployments/Microsoft.Template/operations/A3EB2DA598E0A780
88-
OperationId : A3EB2DA598E0A780
89-
Properties : @{provisioningOperation=Create; provisioningState=Succeeded; timestamp=2019-05-13T21:42:40.7151512Z;
90-
duration=PT23.0227078S; trackingId=11d376e8-5d6d-4da8-847e-6f23c6443fbf;
91-
serviceRequestId=0196828d-8559-4bf6-b6b8-8b9057cb0e23; statusCode=OK; targetResource=}
92-
PropertiesText : {duration:PT23.0227078S, provisioningOperation:Create, provisioningState:Succeeded,
93-
serviceRequestId:0196828d-8559-4bf6-b6b8-8b9057cb0e23...}
94-
```
95-
96-
To get more details about failed operations, retrieve the properties for operations with **Failed** state.
97-
98-
```azurepowershell-interactive
99-
(Get-AzResourceGroupDeploymentOperation -DeploymentName azuredeploy -ResourceGroupName ExampleGroup).Properties | Where-Object ProvisioningState -eq Failed
100-
```
101-
102-
Which returns all the failed operations with each one in the following format:
103-
104-
```powershell
105-
provisioningOperation : Create
106-
provisioningState : Failed
107-
timestamp : 2019-05-13T21:42:40.7151512Z
108-
duration : PT3.1449887S
109-
trackingId : f4ed72f8-4203-43dc-958a-15d041e8c233
110-
serviceRequestId : a426f689-5d5a-448d-a2f0-9784d14c900a
111-
statusCode : BadRequest
112-
statusMessage : @{error=}
113-
targetResource : @{id=/subscriptions/{guid}/resourceGroups/ExampleGroup/providers/
114-
Microsoft.Network/publicIPAddresses/myPublicIP;
115-
resourceType=Microsoft.Network/publicIPAddresses; resourceName=myPublicIP}
45+
Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment
11646
```
11747

118-
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.
119-
120-
To get the status message of a particular failed operation, use the following command:
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:
12149

12250
```azurepowershell-interactive
123-
((Get-AzResourceGroupDeploymentOperation -DeploymentName azuredeploy -ResourceGroupName ExampleGroup).Properties | Where-Object trackingId -eq f4ed72f8-4203-43dc-958a-15d041e8c233).StatusMessage.error
124-
```
125-
126-
Which returns:
127-
128-
```powershell
129-
code message details
130-
---- ------- -------
131-
DnsRecordInUse DNS record dns.westus.cloudapp.azure.com is already used by another public IP. {}
132-
```
133-
134-
Every deployment operation in Azure includes request and response content. During deployment, you can use **DeploymentDebugLogLevel** parameter to specify that the request and/or response are logged.
135-
136-
You get that information from the log, and save it locally by using the following PowerShell commands:
137-
138-
```powershell
139-
(Get-AzResourceGroupDeploymentOperation -DeploymentName "TestDeployment" -ResourceGroupName "Test-RG").Properties.request | ConvertTo-Json | Out-File -FilePath <PathToFile>
140-
141-
(Get-AzResourceGroupDeploymentOperation -DeploymentName "TestDeployment" -ResourceGroupName "Test-RG").Properties.response | ConvertTo-Json | Out-File -FilePath <PathToFile>
51+
(Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment).CorrelationId
14252
```
14353

144-
## Azure CLI
54+
#### [Bash](#tab/bash)
14555

14656
To get the overall status of a deployment, use the **azure group deployment show** command.
14757

@@ -155,13 +65,7 @@ The correlation ID is used to track related events, and can be helpful when work
15565
az group deployment show -g ExampleGroup -n ExampleDeployment --query properties.correlationId
15666
```
15767

158-
To see the operations for a deployment, use:
159-
160-
```azurecli-interactive
161-
az group deployment operation list -g ExampleGroup -n ExampleDeployment
162-
```
163-
164-
## REST
68+
#### [HTTP](#tab/http)
16569

16670
The following example shows how to get information about a deployment. For documentation about the latest API version, see the [Deployments - Get](/rest/api/resources/deployments/get) operation.
16771

@@ -186,6 +90,41 @@ In the response, note in particular the **provisioningState**, **correlationId**
18690
}
18791
```
18892

93+
---
94+
95+
## Get deployment operations
96+
97+
To get details about a deployment from the deployment history use portal, PowerShell, Azure CLI, or REST API.
98+
99+
#### [Browser](#tab/browser)
100+
101+
1. To see deployment operations, select **Operation details**.
102+
103+
![Select deployment operations](./media/resource-manager-deployment-operations/select-deployment-operations.png)
104+
105+
1. You see the details for that step of the deployment.
106+
107+
![Show operation details](./media/resource-manager-deployment-operations/show-operation-details.png)
108+
109+
110+
#### [PowerShell](#tab/powershell)
111+
112+
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**.
113+
114+
```azurepowershell-interactive
115+
Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName azuredeploy
116+
```
117+
118+
#### [Bash](#tab/bash)
119+
120+
To see the operations for a deployment, use:
121+
122+
```azurecli-interactive
123+
az group deployment operation list -g ExampleGroup -n ExampleDeployment
124+
```
125+
126+
#### [HTTP](#tab/http)
127+
189128
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.
190129

191130
```
@@ -219,7 +158,76 @@ The response includes request and/or response information based on what you spec
219158
}
220159
```
221160

161+
---
162+
163+
## Portal
164+
165+
166+
1. If your deployment failed, you see an error message. Select the error message for more details.
167+
168+
![View failed deployment](./media/resource-manager-deployment-operations/show-error.png)
169+
170+
1. The detailed error message is displayed.
171+
172+
![View error details](./media/resource-manager-deployment-operations/show-details.png)
173+
174+
175+
176+
177+
## PowerShell
178+
179+
180+
181+
To get more details about failed operations, retrieve the properties for operations with **Failed** state.
182+
183+
```azurepowershell-interactive
184+
(Get-AzResourceGroupDeploymentOperation -DeploymentName azuredeploy -ResourceGroupName ExampleGroup).Properties | Where-Object ProvisioningState -eq Failed
185+
```
186+
187+
Which returns all the failed operations with each one in the following format:
188+
189+
```powershell
190+
provisioningOperation : Create
191+
provisioningState : Failed
192+
timestamp : 2019-05-13T21:42:40.7151512Z
193+
duration : PT3.1449887S
194+
trackingId : f4ed72f8-4203-43dc-958a-15d041e8c233
195+
serviceRequestId : a426f689-5d5a-448d-a2f0-9784d14c900a
196+
statusCode : BadRequest
197+
statusMessage : @{error=}
198+
targetResource : @{id=/subscriptions/{guid}/resourceGroups/ExampleGroup/providers/
199+
Microsoft.Network/publicIPAddresses/myPublicIP;
200+
resourceType=Microsoft.Network/publicIPAddresses; resourceName=myPublicIP}
201+
```
202+
203+
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.
204+
205+
To get the status message of a particular failed operation, use the following command:
206+
207+
```azurepowershell-interactive
208+
((Get-AzResourceGroupDeploymentOperation -DeploymentName azuredeploy -ResourceGroupName ExampleGroup).Properties | Where-Object trackingId -eq f4ed72f8-4203-43dc-958a-15d041e8c233).StatusMessage.error
209+
```
210+
211+
Which returns:
212+
213+
```powershell
214+
code message details
215+
---- ------- -------
216+
DnsRecordInUse DNS record dns.westus.cloudapp.azure.com is already used by another public IP. {}
217+
```
218+
219+
Every deployment operation in Azure includes request and response content. During deployment, you can use **DeploymentDebugLogLevel** parameter to specify that the request and/or response are logged.
220+
221+
You get that information from the log, and save it locally by using the following PowerShell commands:
222+
223+
```powershell
224+
(Get-AzResourceGroupDeploymentOperation -DeploymentName "TestDeployment" -ResourceGroupName "Test-RG").Properties.request | ConvertTo-Json | Out-File -FilePath <PathToFile>
225+
226+
(Get-AzResourceGroupDeploymentOperation -DeploymentName "TestDeployment" -ResourceGroupName "Test-RG").Properties.response | ConvertTo-Json | Out-File -FilePath <PathToFile>
227+
```
228+
222229
## Next steps
230+
223231
* For help with resolving particular deployment errors, see [Resolve common errors when deploying resources to Azure with Azure Resource Manager](resource-manager-common-deployment-errors.md).
224232
* To learn about using the activity logs to monitor other types of actions, see [View activity logs to manage Azure resources](resource-group-audit.md).
225233
* To validate your deployment before executing it, see [Deploy a resource group with Azure Resource Manager template](resource-group-template-deploy.md).

0 commit comments

Comments
 (0)