| title | Use Bicep linter |
|---|---|
| description | Learn how to use Bicep linter. |
| ms.topic | how-to |
| ms.custom | devx-track-bicep |
| ms.date | 01/30/2026 |
The Bicep linter checks Bicep files for syntax errors and best practice violations. The linter helps enforce coding standards by providing guidance during development. You can customize the best practices to use for checking the file.
The linter is integrated into the Bicep CLI and the Bicep extension for Visual Studio Code. To use it, you must have Bicep CLI version 0.4 or later.
The default set of linter rules is minimal and taken from arm-ttk test cases. The extension and Bicep CLI check the following rules, which are set to the warning level.
You can enable or disable all linter rules and control how they are applied using a configuration file. To override the default behavior, create a bicepconfig.json file with your custom settings. For more information about applying those settings, see Add custom settings in the Bicep config file.
The following screenshot shows the linter in Visual Studio Code:
:::image type="content" source="./media/linter/bicep-linter-show-errors.png" alt-text="Bicep linter usage in Visual Studio Code.":::
In the PROBLEMS pane, there are four errors, one warning, and one info message shown in the screenshot. The info message shows the Bicep configuration file that is used. It only shows this piece of information when you set verbose to true in the configuration file.
Hover your mouse cursor to one of the problem areas. Linter gives the details about the error or warning. Select the area, it also shows a blue light bulb:
:::image type="content" source="./media/linter/bicep-linter-show-quickfix.png" alt-text="Bicep linter usage in Visual Studio Code - show quickfix.":::
Select either the light bulb or the Quick fix link to see the solution:
:::image type="content" source="./media/linter/bicep-linter-show-quickfix-solution.png" alt-text="Bicep linter usage in Visual Studio Code - show quickfix solution.":::
Select the solution to fix the issue automatically.
The following screenshot shows the linter in the command line. The output from the lint command and the build command shows any rule violations.
:::image type="content" source="./media/linter/bicep-linter-command-line.png" alt-text="Bicep linter usage in command line.":::
You can integrate these checks as a part of your CI/CD pipelines. You can use a GitHub action to attempt a bicep build. Errors will fail the pipelines.
Sometimes a rule has false positives. For example, you might need to include a link to a blob storage directly without using the environment() function.
You can suppress Bicep linter rules by using disable-next-line and disable-diagnostics. See Directives. If you want to suppress a linter rule, change the level of the rule to Off in bicepconfig.json. In the following example, the no-deployments-resources rule is suppressed:
{
"analyzers": {
"core": {
"rules": {
"no-deployments-resources": {
"level": "off"
}
}
}
}
}- For more information about customizing the linter rules, see Add custom settings in the Bicep config file.
- For more information about using Visual Studio Code and the Bicep extension, see Quickstart: Create Bicep files with Visual Studio Code.