You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/bicep-core-diagnostics.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@ ms.date: 01/16/2026
14
14
15
15
If you need more information about a particular diagnostic code, select the **Feedback** button in the upper-right corner of the page and specify the code.
16
16
17
-
You can suppress Bicep diagnostic codes by using the `disable-next-line` directive. See [`disable-next-line`](./file.md#disable-next-line).
17
+
You can suppress Bicep diagnostic codes by using `disable-next-line` and `disable-diagnostics`. See [Directives](./file.md#directives).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/file.md
+40-43Lines changed: 40 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Bicep file structure and syntax
3
3
description: Understand how to use declarative syntax to understand the structure and properties of Bicep files.
4
4
ms.topic: article
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 01/13/2026
6
+
ms.date: 01/30/2026
7
7
---
8
8
9
9
# Bicep file structure and syntax
@@ -14,9 +14,9 @@ For a step-by-step tutorial that guides you through the process of creating a Bi
14
14
15
15
## Known limitations
16
16
17
-
*Support isn't available for the concept of `apiProfile`, which is used to map a single `apiProfile` to a set `apiVersion` for each resource type.
17
+
*The Bicep language doesn't support the concept of `apiProfile`. This concept maps a single `apiProfile` to a set `apiVersion` for each resource type.
18
18
* User-defined functions aren't supported at this time. An experimental feature is currently accessible. For more information, see [User-defined functions in Bicep](./user-defined-functions.md).
19
-
* Some Bicep features require a corresponding change to the intermediate language (Azure Resource Manager JSON templates). We announce these features as available after all the required updates are deployed to global Azure. If you use a different environment such as Azure Stack, there might be a delay in the availability of the feature. The Bicep feature is available only after the intermediate language is also updated in that environment.
19
+
* Some Bicep features require a corresponding change to the intermediate language (Azure Resource Manager JSON templates). The product team announces these features as available after all the required updates are deployed to global Azure. If you use a different environment such as Azure Stack, there might be a delay in the availability of the feature. The Bicep feature is available only after the intermediate language is also updated in that environment.
Metadata in Bicep is an untyped value that you can include in your Bicep files. Metadata provides supplementary information about your Bicep files, like name, description, author, and creation date.
102
+
Metadata in Bicep is an untyped value that you can include in your Bicep files. Metadata provides supplementary information about your Bicep files, such as name, description, author, and creation date.
103
103
104
104
## Target scope
105
105
106
-
By default, the target scope is set to `resourceGroup`. If you deploy at the resource-group level, you don't need to set the target scope in your Bicep file.
106
+
The defaulttarget scope is `resourceGroup`. If you deploy at the resourcegroup level, you don't need to set the target scope in your Bicep file.
107
107
108
108
The allowed values are:
109
109
@@ -112,7 +112,7 @@ The allowed values are:
112
112
*`managementGroup`: Used for [management group deployments](deploy-to-management-group.md).
113
113
*`tenant`: Used for [tenant deployments](deploy-to-tenant.md).
114
114
115
-
In a module, you can specify a scope that's different than the scope for the rest of the Bicep file. For more information, see [Configure module scope](modules.md#set-module-scope).
115
+
In a module, you can specify a scope that's different from the scope for the rest of the Bicep file. For more information, see [Configure module scope](modules.md#set-module-scope).
116
116
117
117
## Parameters
118
118
@@ -138,13 +138,13 @@ For more information, see [Parameters in Bicep](./parameters.md).
138
138
139
139
## Variables
140
140
141
-
To make your Bicep file more readable, encapsulate complex expressions in a variable. For example, you might add a variable for a resource name that's constructed by concatenating several values together.
141
+
To make your Bicep file more readable, encapsulate complex expressions in a variable. For example, you might add a variable for a resource name that you create by concatenating several values together.
142
142
143
143
```bicep
144
144
var uniqueStorageName = '${storagePrefix}${uniqueString(resourceGroup().id)}'
145
145
```
146
146
147
-
Apply this variable wherever you need the complex expression.
147
+
Use this variable wherever you need the complex expression.
@@ -157,7 +157,7 @@ For more information, see [Variables in Bicep](./variables.md).
157
157
158
158
## Resources
159
159
160
-
Use the `resource` keyword to define a resource to deploy. Your resource declaration includes a symbolic name for the resource. You use this symbolic name in other parts of the Bicep file to get a value from the resource.
160
+
Use the `resource` keyword to define a resource to deploy. Your resource declaration includes a symbolic name for the resource. Use this symbolic name in other parts of the Bicep file to get a value from the resource.
161
161
162
162
The resource declaration includes the resource type and API version. Within the body of the resource declaration, include properties that are specific to the resource type.
163
163
@@ -229,7 +229,7 @@ For more information, see [Set name and type for child resources in Bicep](child
229
229
230
230
## Modules
231
231
232
-
Modules enable you to reuse code from a Bicep file in other Bicep files. In the module declaration, you link to the file to reuse. When you deploy the Bicep file, the resources in the module are also deployed.
232
+
Modules enable you to reuse code from a Bicep file in other Bicep files. In the module declaration, you link to the file to reuse. When you deploy the Bicep file, you also deploy the resources in the module.
233
233
234
234
```bicep
235
235
module webModule './webApp.bicep' = {
@@ -261,7 +261,7 @@ For more information, see [Outputs in Bicep](./outputs.md).
261
261
262
262
## Types
263
263
264
-
You can use the `type` statement to define user-defined data types.
264
+
Use the `type` statement to define user-defined data types.
265
265
266
266
```bicep
267
267
param location string = resourceGroup().location
@@ -294,7 +294,7 @@ For more information, see [User-defined data types in Bicep](./user-defined-data
294
294
295
295
## Functions
296
296
297
-
In your Bicep file, you can create your own functions and also use the [standard Bicep functions](./bicep-functions.md) that are automatically available within your Bicep files. Create your own functions when you have complicated expressions that are used repeatedly in your Bicep files.
297
+
In your Bicep file, you can create your own functions and also use the [standard Bicep functions](./bicep-functions.md) that are automatically available within your Bicep files. Create your own functions when you have complicated expressions that you use repeatedly in your Bicep files.
@@ -306,7 +306,7 @@ For more information, see [User-defined functions in Bicep](./user-defined-funct
306
306
307
307
## Decorators
308
308
309
-
You can add one or more decorators for each of the following elements:
309
+
Add one or more decorators to each of the following elements:
310
310
311
311
*[param](#parameters)
312
312
*[var](#variables)
@@ -335,44 +335,42 @@ The following table lists the decorators:
335
335
336
336
## Directives
337
337
338
-
Directives provide instructions to the Bicep compiler and linter without affecting the runtime behavior of a template. You write directives as comments. The compiler evaluates them during compilation and validation.
339
-
340
-
A directive uses the following general syntax:
338
+
Bicep supports directives (pragmas) to control certain behaviors within the file, such as suppressing linter warnings or warning diagnostic messages. Directives are prefixed with the `#` character.
341
339
342
340
```bicep
343
341
#<directive-name> <argument1> [<argument2> ... ]
344
342
```
345
343
346
-
You separate arguments by using spaces. The specific directive determines how to interpret the arguments.
347
-
348
-
### `disable-next-line`
349
-
350
-
Use the `#disable-next-line` directive to suppress diagnostics for the statement immediately following the directive. You must specify at least one identifier after the directive. If you don't provide any identifiers, the compiler reports an error. The identifiers you specify after the directive can refer to:
344
+
You must specify at least one identifier after the directive. If you don't provide any identifiers, the compiler reports an error. The identifiers you specify after the directive can refer to:
351
345
352
346
*[Bicep compiler diagnostics](./bicep-core-diagnostics.md), such as `BCP138`
353
347
*[Bicep linter rules](./linter.md), such as `no-unused-params`
354
348
355
-
The following example suppresses a compiler diagnostic:
349
+
You separate arguments by using spaces. The linter rules and diagnostic codes are case sensitive.
The following example suppresses multiple diagnostics and rules:
372
358
373
359
```bicep
374
-
#disable-next-line BCP138 no-unused-params
375
-
param example string
360
+
#disable-diagnostics no-unused-vars BCP335
361
+
362
+
var location = 'eastus'
363
+
364
+
param storageCount int
365
+
366
+
resource accounts 'Microsoft.Storage/storageAccounts@2025-06-01' = [for i in range(0, storageCount): if (i % 2 == 0) {
367
+
name: 'sa0820${i}'
368
+
location: resourceGroup().location
369
+
sku: {
370
+
name: 'Standard_LRS'
371
+
}
372
+
kind: 'StorageV2'
373
+
}]
376
374
```
377
375
378
376
Use directives sparingly and only when you review and intentionally suppress a diagnostic or linter rule. Excessive use can reduce template readability and maintainability. Add a comment explaining why the rules or the diagnostic codes don't apply to this line.
@@ -405,7 +403,7 @@ For more information, see [Iterative loops in Bicep](loops.md).
405
403
406
404
## Conditional deployment
407
405
408
-
You can add a resource or module to your Bicep file that's conditionally deployed. During deployment, the condition is evaluated and the result determines whether the resource or module is deployed. Use the `if` expression to define a conditional deployment.
406
+
You can add a resource or module to your Bicep file for conditional deployment. During deployment, the condition is evaluated and the result determines whether the resource or module is deployed. Use the `if` expression to define a conditional deployment.
409
407
410
408
```bicep
411
409
param deployZone bool
@@ -420,17 +418,17 @@ For more information, see [Conditional deployments in Bicep with the if expressi
420
418
421
419
## Whitespace
422
420
423
-
Spaces and tabs are ignored when you author Bicep files.
421
+
Bicep files ignore spaces and tabs.
424
422
425
-
Bicep is newline sensitive. For example:
423
+
Bicep is sensitive to newlines. For example:
426
424
427
425
```bicep
428
426
resource sa 'Microsoft.Storage/storageAccounts@2025-06-01' = if (newOrExisting == 'new') {
429
427
...
430
428
}
431
429
```
432
430
433
-
Can't be written as:
431
+
You can't write it as:
434
432
435
433
```bicep
436
434
resource sa 'Microsoft.Storage/storageAccounts@2025-06-01' =
@@ -439,7 +437,7 @@ resource sa 'Microsoft.Storage/storageAccounts@2025-06-01' =
439
437
}
440
438
```
441
439
442
-
Define [objects](./data-types.md#objects) and [arrays](./data-types.md#arrays)in multiple lines.
440
+
You can define [objects](./data-types.md#objects) and [arrays](./data-types.md#arrays)across multiple lines.
443
441
444
442
## Comments
445
443
@@ -480,6 +478,5 @@ For multiple-line declaration samples, see [arrays](./data-types.md#arrays) and
480
478
481
479
## Related content
482
480
483
-
* For an introduction to Bicep, see [What is Bicep?](./overview.md).
481
+
* For an introduction to Bicep, see [What is Bicep?](./overview.md)
484
482
* For Bicep data types, see [Data types](./data-types.md).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/linter.md
+2-11Lines changed: 2 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Use Bicep linter
3
3
description: Learn how to use Bicep linter.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 01/16/2026
6
+
ms.date: 01/30/2026
7
7
---
8
8
9
9
# Use Bicep linter
@@ -94,16 +94,7 @@ You can integrate these checks as a part of your CI/CD pipelines. You can use a
94
94
95
95
Sometimes a rule has false positives. For example, you might need to include a link to a blob storage directly without using the [environment()](./bicep-functions-deployment.md#environment) function.
96
96
97
-
In this case, you can disable the warning for one line only, not the entire document, by adding the `#disable-next-line` directive before the line with the warning.
98
-
99
-
```bicep
100
-
#disable-next-line no-hardcoded-env-urls //Direct download link to my toolset
For more information about using directives in Bicep, see [Directives](./file.md#directives).
105
-
106
-
If you want to suppress a linter rule, change the level of the rule to `Off` in [bicepconfig.json](./bicep-config-linter.md). In the following example, the `no-deployments-resources` rule is suppressed:
97
+
You can suppress Bicep linter rules by using `disable-next-line` and `disable-diagnostics`. See [Directives](./file.md#directives). If you want to suppress a linter rule, change the level of the rule to `Off` in [bicepconfig.json](./bicep-config-linter.md). In the following example, the `no-deployments-resources` rule is suppressed:
0 commit comments