|
2 | 2 | title: Overview of ARM template and Bicep file troubleshooting
|
3 | 3 | description: Describes troubleshooting for Azure resource deployment with Azure Resource Manager templates (ARM templates) and Bicep files.
|
4 | 4 | ms.topic: overview
|
5 |
| -ms.date: 11/01/2021 |
| 5 | +ms.date: 10/26/2021 |
6 | 6 | ms.custom: troubleshooting-overview
|
7 | 7 | ---
|
8 | 8 |
|
9 | 9 | # What is deployment troubleshooting?
|
10 | 10 |
|
11 |
| -Azure Resource Manager templates (ARM templates) and Bicep files are used to automate deployment of Azure resources. Errors can occur and the documentation helps you troubleshoot problems and find solutions. The errors must be resolved so that you can deploy the Azure resources you need. |
| 11 | +When you deploy Bicep files or Azure Resource Manager templates (ARM templates), you may get an error. This documentation helps you find possible solutions for the error. |
12 | 12 |
|
13 |
| -## Deployment errors |
| 13 | +## Error types |
14 | 14 |
|
15 |
| -Deployment errors are caused by various reasons and can occur during validation before deployment begins or during the deployment. |
| 15 | +There are two types of errors you can get - **validation errors** and **deployment errors**. |
16 | 16 |
|
17 |
| -Validation errors are caused by incorrect syntax, like missing arguments in a function or an invalid element name such as misspelling `apiVersion`. |
| 17 | +Validation errors happen before the deployment is started. These errors can be determined without interacting with your current Azure environment. For example, validation makes you aware of syntax errors or missing arguments for a function before your deployment starts. |
18 | 18 |
|
19 |
| -Deployment errors occur when an invalid value is used, like an API version that doesn't exist for a resource provider. Another example is a resource that wasn't created but is referenced by another resource. For example, a virtual machine (VM) deployment requires a network interface card (NIC). During deployment, if the VM deploys before the NIC, a deployment error occurs. One way to ensure a resource exists before another resource tries to use it during deployment, is to use the `dependsOn` element. Conditional deployments are another option. |
| 19 | +Deployment errors can only be determined by attempting the deployment and interacting with your Azure environment. For example, a virtual machine (VM) requires a network interface card (NIC). If the NIC doesn't exist when the VM is deployed, you get a deployment error. |
20 | 20 |
|
21 | 21 | ## Troubleshooting tools
|
22 | 22 |
|
23 |
| -To help identify syntax errors before a deployment, use the latest versions of [Visual Studio Code](https://code.visualstudio.com) and the [Azure Resource Manager Tools extension](https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools) or [Bicep extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-bicep). |
| 23 | +To help identify syntax errors before a deployment, use the latest version of [Visual Studio Code](https://code.visualstudio.com). Install the latest version of either: |
24 | 24 |
|
25 |
| -To troubleshoot ARM templates and Bicep files it's helpful to learn about a resource provider's properties or API versions. For more information, see [Define resources with Bicep and ARM templates](/azure/templates). |
| 25 | +* [Bicep extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-bicep) |
| 26 | +* [Azure Resource Manager Tools extension](https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools) |
26 | 27 |
|
27 |
| -You can also use the [ARM template test toolkit](../templates/test-toolkit.md) to validate syntax. For Bicep files, use the [Bicep linter](../bicep/linter.md). The toolkit and linter find common errors without doing a deployment. |
| 28 | +To troubleshoot deployments, it's helpful to learn about a resource provider's properties or API versions. For more information, see [Define resources with Bicep and ARM templates](/azure/templates). |
| 29 | + |
| 30 | +To follow best practices for developing your templates, use either: |
| 31 | + |
| 32 | +* [Bicep linter](../bicep/linter.md) |
| 33 | +* [ARM template test toolkit](../templates/test-toolkit.md) |
28 | 34 |
|
29 | 35 | When you deploy, you can find the cause of errors from the Azure portal in a resource group's **Deployments** or **Activity log**. If you're using Azure PowerShell, use commands like [Get-AzResourceGroupDeploymentOperation](/powershell/module/az.resources/get-azresourcegroupdeploymentoperation) and [Get-AzActivityLog](/powershell/module/az.monitor/get-azactivitylog). For Azure CLI, use commands like [az deployment operation group](/cli/azure/deployment/operation/group) and [az monitor activity-log list](/cli/azure/monitor/activity-log#az_monitor_activity_log_list).
|
30 | 36 |
|
31 | 37 | ## Next steps
|
32 | 38 |
|
33 |
| -- To learn more about ARM templates, see the [ARM template documentation](/azure/azure-resource-manager/templates). |
34 |
| -- To learn more about Bicep, see the [Bicep documentation](/azure/azure-resource-manager/bicep). |
| 39 | +- For solutions based on the error code, see [Troubleshoot common Azure deployment errors](common-deployment-errors.md). |
| 40 | +- For an introduction to finding the error code, see [Quickstart: Troubleshoot ARM template deployments](quickstart-troubleshoot-arm-deployment.md) or [Quickstart: Troubleshoot Bicep file deployments](quickstart-troubleshoot-bicep-deployment.md). |
0 commit comments