Find error codes

When an Azure resource deployment fails using Azure Resource Manager templates (ARM templates) or Bicep files, an error code is received. This article describes how to find error codes so you can troubleshoot the problem. For more information about error codes, see common deployment errors.

Error types

There are three types of errors that are related to a deployment:

  • Validation errors occur before a deployment begins and are caused by syntax errors in your file. Your editor can identify these errors.
  • Preflight validation errors occur when a deployment command is run but resources aren't deployed. These errors are found without starting the deployment. For example, if a parameter value is incorrect, the error is found in preflight validation.
  • Deployment errors occur during the deployment process and can only be found by assessing the deployment's progress.

All types of errors return an error code that you use to troubleshoot the deployment. Validation and preflight errors are shown in the activity log but don't appear in your deployment history. A Bicep file with syntax errors doesn't compile into JSON and isn't shown in the activity log.

To identify syntax errors, you can use Visual Studio Code with the latest Bicep extension or Azure Resource Manager Tools extension.

Validation errors

Templates are validated during the deployment process and error codes are displayed. Before you run a deployment, you can run validation tests with Azure PowerShell or Azure CLI to identify validation and preflight errors.

An ARM template can be deployed from the portal. If the template has syntax errors, you'll see a validation error when you try to run the deployment. For more information about portal deployments, see deploy resources from custom template.

The following example attempts to deploy a storage account and a validation error occurs.

Screenshot of an Azure portal validation error.

Select the message for more details. The template has a syntax error with error code InvalidTemplate. The Summary shows an expression is missing a closing parenthesis.

Screenshot of a validation error message that shows a syntax error.

Deployment errors

Several operations are processed to deploy an Azure resource. Deployment errors occur when an operation passes validation but fails during deployment. You can view messages about each deployment operation and each deployment for a resource group.

To see messages about a deployment's operations, use the resource group's Activity log:

  1. Sign in to Azure portal.

  2. Go to Resource groups and select the deployment's resource group name.

  3. Select Activity log.

  4. Use the filters to find an operation's error log.

    Screenshot of the resource group's activity log that highlights a failed deployment.

  5. Select the error log to see the operation's details.

    Screenshot of the activity log details that shows a failed deployment's error message.

To view a deployment's result:

  1. Go to the resource group.

  2. Select Settings > Deployments.

  3. Select Error details for the deployment.

    Screenshot of a resource group's link to error details for a failed deployment.

  4. The error message and error code NoRegisteredProviderFound are shown.

    Screenshot of a message that shows deployment error details.

Next steps