Skip to content

Latest commit

 

History

History
506 lines (339 loc) · 20.1 KB

deployment-history.md

File metadata and controls

506 lines (339 loc) · 20.1 KB
title description tags ms.topic ms.date ms.custom
Deployment history
Describes how to view Azure Resource Manager deployment operations with the portal, PowerShell, Azure CLI, and REST API.
top-support-issue
conceptual
03/20/2024
devx-track-azurepowershell, devx-track-azurecli, devx-track-arm-template

View deployment history with Azure Resource Manager

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.

  1. Select the resource group you want to examine.

    :::image type="content" source="media/deployment-history/select-resource-group.png" alt-text="Screenshot of selecting resource group.":::

  2. Select the link under Deployments.

    :::image type="content" source="media/deployment-history/select-deployment-history.png" alt-text="Screenshot of resource group overview that shows successful deployment.":::

  3. Select one of the deployments from the deployment history.

    :::image type="content" source="media/deployment-history/select-details.png" alt-text="Screenshot of highlighted link for a resource deployment.":::

  4. A summary of the deployment is displayed, including the correlation ID.

    :::image type="content" source="media/deployment-history/show-correlation-id.png" alt-text="Screenshot of resource group deployment history that highlights 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": "11111111-1111-1111-1111-111111111111",
   ...
 }
}

Subscription deployments

You can view the history of deployments to a subscription.

  1. Select the subscription you want to examine.

    :::image type="content" source="media/deployment-history/select-subscription.png" alt-text="Screenshot of selecting subscription.":::

  2. In the left pane, select Deployments.

    :::image type="content" source="media/deployment-history/select-subscription-deployments.png" alt-text="Screenshot of subscription with deployments option.":::

  3. Select one of the deployments from the deployment history.

    :::image type="content" source="media/deployment-history/select-deployment-from-subscription.png" alt-text="Screenshot of deployment history for a subscription.":::

  4. A summary of the deployment is displayed, including the correlation ID.

    :::image type="content" source="media/deployment-history/subscription-deployment-details.png" alt-text="Screenshot of subscription deployment history that highlights 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": "11111111-1111-1111-1111-111111111111",
   ...
 }
}

Management group deployments

You can view the history of deployments to a management group.

  1. 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.

    :::image type="content" source="media/deployment-history/select-management-group.png" alt-text="Screenshot of selecting management group.":::

  2. In the left pane, select Deployments.

    :::image type="content" source="media/deployment-history/select-management-group-deployments.png" alt-text="Screenshot of management group overview that shows deployment option.":::

  3. Select one of the deployments from the deployment history.

    :::image type="content" source="media/deployment-history/select-deployment-from-management-group.png" alt-text="Screenshot of deployment history for management group.":::

  4. A summary of the deployment is displayed, including the correlation ID.

    :::image type="content" source="media/deployment-history/management-group-history.png" alt-text="Screenshot of management group deployment history that highlights 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": "11111111-1111-1111-1111-111111111111",
   ...
 }
}

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": "11111111-1111-1111-1111-111111111111",
   ...
 }
}

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.

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

    :::image type="content" source="media/deployment-history/get-operation-details.png" alt-text="Screenshot of failed deployment that highlights link for operation details.":::

  2. You see the details for that step of the deployment. When an error occurs, the details include the error message.

    :::image type="content" source="media/deployment-history/see-operation-details.png" alt-text="Screenshot of failed deployment's operation details.":::

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/11111111-1111-1111-1111-111111111111/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": "11111111-1111-1111-1111-111111111111",
        "serviceRequestId": "11111111-1111-1111-1111-111111111111",
        "statusCode": "BadRequest",
        "statusMessage": {
          "error": {
            "code": "InvalidAccountType",
            "message": "The AccountType Standard_LRS1 is invalid. For more information, see - https://aka.ms/storageaccountskus"
          }
        },
        "targetResource": {
          "id": "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/examplegroup/providers/Microsoft.Storage/storageAccounts/storage",
          "resourceType": "Microsoft.Storage/storageAccounts",
          "resourceName": "storage"
        }
      }
    },
    ...
  ]
}

To view deployment operations for other scopes, use:


Next steps