Azure Resource Manager enables you to view your deployment history. You can examine specific operations in past deployments and see which resources were deployed. This history contains information about any errors.
The deployment history for a resource group is limited to 800 deployments. As you near the limit, deployments are automatically deleted from the history. For more information, see Automatic deletions from deployment history.
For help with resolving particular deployment errors, see Troubleshoot common Azure deployment errors.
Correlation ID and support
Each deployment has a correlation ID, which is used to track related events. If you create an Azure support request, support may ask you for the correlation ID. Support uses the correlation ID to identify the operations for the failed deployment.
The examples in this article show how to retrieve the correlation ID.
Resource group deployments
You can view details about a resource group deployment through the Azure portal, PowerShell, Azure CLI, or REST API.
Select the resource group you want to examine.
Select the link under Deployments.
Select one of the deployments from the deployment history.
A summary of the deployment is displayed, including the correlation ID.
To list all deployments for a resource group, use the Get-AzResourceGroupDeployment command.
Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup
To get a specific deployment from a resource group, add the DeploymentName
parameter.
Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment
To get the correlation ID, use:
(Get-AzResourceGroupDeployment -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment).CorrelationId
To list all the deployments for a resource group, use az deployment group list.
az deployment group list --resource-group ExampleGroup
To get a specific deployment, use the az deployment group show.
az deployment group show --resource-group ExampleGroup --name ExampleDeployment
To get the correlation ID, use:
az deployment group show --resource-group ExampleGroup --name ExampleDeployment --query properties.correlationId
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.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/?api-version={api-version}
To get a specific deployment, use the following operation. For the latest API version number to use in the request, see Deployments - Get.
GET https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/microsoft.resources/deployments/{deployment-name}?api-version={api-version}
The response includes the correlation ID.
{
...
"properties": {
"mode": "Incremental",
"provisioningState": "Failed",
"timestamp": "2019-11-26T14:18:36.4518358Z",
"duration": "PT26.2091817S",
"correlationId": "aaaa0000-bb11-2222-33cc-444444dddddd",
...
}
}
Subscription deployments
You can view the history of deployments to a subscription.
Select the subscription you want to examine.
In the left pane, select Deployments.
Select one of the deployments from the deployment history.
A summary of the deployment is displayed, including the correlation ID.
To list all deployments for the current subscription, use the Get-AzSubscriptionDeployment
command. This command is equivalent to Get-AzDeployment.
Get-AzSubscriptionDeployment
To get a specific deployment from a subscription, add the Name
parameter.
Get-AzSubscriptionDeployment -Name ExampleDeployment
To get the correlation ID, use:
(Get-AzSubscriptionDeployment -Name ExampleDeployment).CorrelationId
To list all the deployments for the current subscription, use az deployment sub list.
az deployment sub list
To get a specific deployment, use the az deployment sub show.
az deployment sub show --name ExampleDeployment
To get the correlation ID, use:
az deployment sub show --name ExampleDeployment --query properties.correlationId
To list the deployments for a subscription, use the following operation. For the latest API version number to use in the request, see Deployments - List At Subscription Scope.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/?api-version={api-version}
To get a specific deployment, use the following operation. For the latest API version number to use in the request, see Deployments - Get At Subscription Scope.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}?api-version={api-version}
The response includes the correlation ID.
{
...
"properties": {
"mode": "Incremental",
"provisioningState": "Failed",
"timestamp": "2019-11-26T14:18:36.4518358Z",
"duration": "PT26.2091817S",
"correlationId": "aaaa0000-bb11-2222-33cc-444444dddddd",
...
}
}
Management group deployments
You can view the history of deployments to a management group.
Select the management group you want to examine. If you don't have sufficient permissions to view details about the management group, you won't be able to select it.
In the left pane, select Deployments.
Select one of the deployments from the deployment history.
A summary of the deployment is displayed, including the correlation ID.
To list all deployments for a management group, use the Get-AzManagementGroupDeployment command. If you don't have sufficient permissions to view deployments for the management group, you'll get an error.
Get-AzManagementGroupDeployment -ManagementGroupId examplemg
To get a specific deployment from a management group, add the Name
parameter.
Get-AzManagementGroupDeployment -ManagementGroupId examplemg -Name ExampleDeployment
To get the correlation ID, use:
(Get-AzManagementGroupDeployment -ManagementGroupId examplemg -Name ExampleDeployment).CorrelationId
To list all the deployments for a management group, use az deployment mg list. If you don't have sufficient permissions to view deployments for the management group, you'll get an error.
az deployment mg list --management-group-id examplemg
To get a specific deployment, use the az deployment mg show.
az deployment mg show --management-group-id examplemg --name ExampleDeployment
To get the correlation ID, use:
az deployment mg show --management-group-id examplemg --name ExampleDeployment --query properties.correlationId
To list the deployments for a management group, use the following operation. For the latest API version number to use in the request, see Deployments - List At Management Group Scope. If you don't have sufficient permissions to view deployments for the management group, you'll get an error.
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/?api-version={api-version}
To get a specific deployment, use the following operation. For the latest API version number to use in the request, see Deployments - Get At Management Group Scope.
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}?api-version={api-version}
The response includes the correlation ID.
{
...
"properties": {
"mode": "Incremental",
"provisioningState": "Failed",
"timestamp": "2019-11-26T14:18:36.4518358Z",
"duration": "PT26.2091817S",
"correlationId": "aaaa0000-bb11-2222-33cc-444444dddddd",
...
}
}
Tenant deployments
You can view the history of deployments to a tenant.
The portal doesn't currently show tenant deployments.
To list all deployments for the current tenant, use the Get-AzTenantDeployment command. If you don't have sufficient permissions to view deployments for the tenant, you'll get an error.
Get-AzTenantDeployment
To get a specific deployment from the current tenant, add the Name
parameter.
Get-AzTenantDeployment -Name ExampleDeployment
To get the correlation ID, use:
(Get-AzTenantDeployment -Name ExampleDeployment).CorrelationId
To list all the deployments for the current tenant, use az deployment tenant list. If you don't have sufficient permissions to view deployments for the tenant, you'll get an error.
az deployment tenant list
To get a specific deployment, use the az deployment tenant show.
az deployment tenant show --name ExampleDeployment
To get the correlation ID, use:
az deployment tenant show --name ExampleDeployment --query properties.correlationId
To list the deployments for the current tenant, use the following operation. For the latest API version number to use in the request, see Deployments - List At Tenant Scope. If you don't have sufficient permissions to view deployments for the tenant, you'll get an error.
GET https://management.azure.com/providers/Microsoft.Resources/deployments/?api-version={api-version}
To get a specific deployment, use the following operation. For the latest API version number to use in the request, see Deployments - Get At Tenant Scope.
GET https://management.azure.com/providers/Microsoft.Resources/deployments/{deploymentName}?api-version={api-version}
The response includes the correlation ID.
{
...
"properties": {
"mode": "Incremental",
"provisioningState": "Failed",
"timestamp": "2019-11-26T14:18:36.4518358Z",
"duration": "PT26.2091817S",
"correlationId": "aaaa0000-bb11-2222-33cc-444444dddddd",
...
}
}
Deployment operations and error message
Each deployment can include multiple operations. To see more details about a deployment, view the deployment operations. When a deployment fails, the deployment operations include an error message.
On the summary for a deployment, select Operation details.
You see the details for that step of the deployment. When an error occurs, the details include the error message.
To view the deployment operations for deployment to a resource group, use the Get-AzResourceGroupDeploymentOperation command.
Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -DeploymentName ExampleDeployment
To view failed operations, filter operations with Failed state.
Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -Name ExampleDeployment | Where-Object { $_.ProvisioningState -eq "Failed" }
To get the status message of failed operations, use the following command:
(Get-AzResourceGroupDeploymentOperation -ResourceGroupName ExampleGroup -Name ExampleDeployment | Where-Object { $_.ProvisioningState -eq "Failed" }).StatusMessage
To view deployment operations for other scopes, use:
To view the deployment operations for deployment to a resource group, use the az deployment operation group list command. You must have Azure CLI 2.6.0 or later.
az deployment operation group list --resource-group ExampleGroup --name ExampleDeployment
To view failed operations, filter operations with Failed state.
az deployment operation group list --resource-group ExampleGroup --name ExampleDeployment --query "[?properties.provisioningState=='Failed']"
To get the status message of failed operations, use the following command:
az deployment operation group list --resource-group ExampleGroup --name ExampleDeployment --query "[?properties.provisioningState=='Failed'].properties.statusMessage.error"
To view deployment operations for other scopes, use:
To get deployment operations, use the following operation. For the latest API version number to use in the request, see Deployment Operations - List.
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}
The response includes an error message.
{
"value": [
{
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/examplegroup/providers/Microsoft.Resources/deployments/exampledeployment/operations/1234567890ABCDEF",
"operationId": "1234567890ABCDEF",
"properties": {
"provisioningOperation": "Create",
"provisioningState": "Failed",
"timestamp": "2019-11-26T14:18:36.3177613Z",
"duration": "PT21.0580179S",
"trackingId": "aaaa0000-bb11-2222-33cc-444444dddddd",
"serviceRequestId": "aaaa0000-bb11-2222-33cc-444444dddddd",
"statusCode": "BadRequest",
"statusMessage": {
"error": {
"code": "InvalidAccountType",
"message": "The AccountType Standard_LRS1 is invalid. For more information, see - https://aka.ms/storageaccountskus"
}
},
"targetResource": {
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/examplegroup/providers/Microsoft.Storage/storageAccounts/storage",
"resourceType": "Microsoft.Storage/storageAccounts",
"resourceName": "storage"
}
}
},
...
]
}
To view deployment operations for other scopes, use:
Next steps