Skip to content

Commit 37f76c4

Browse files
Merge pull request #295550 from LiSeda/LS-batch7
LS_Bicep_Batch 7
2 parents 55688b9 + 063ceb1 commit 37f76c4

File tree

5 files changed

+181
-183
lines changed

5 files changed

+181
-183
lines changed

articles/azure-resource-manager/bicep/bicep-core-diagnostics.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Bicep warnings and error codes
3-
description: Lists the warnings and error codes.
3+
description: Understand Bicep warnings and error codes.
44
ms.topic: conceptual
55
ms.custom: devx-track-azurecli, devx-track-bicep, devx-track-arm-template
6-
ms.date: 02/20/2025
6+
ms.date: 03/25/2025
77
---
88

99
# Bicep core diagnostics
1010

11-
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.
11+
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.
1212

1313
| Code | Level | Description |
1414
|------------|-------|-_-----------|
@@ -36,16 +36,16 @@ If you need more information about a particular diagnostic code, select the **Fe
3636
| <a id='BCP023' />BCP023 | Error | Expected a variable or function name at this location. |
3737
| <a id='BCP024' />BCP024 | Error | The identifier exceeds the limit of {LanguageConstants.MaxIdentifierLength}. Reduce the length of the identifier. |
3838
| <a id='BCP025' />BCP025 | Error | The property "{property}" is declared multiple times in this object. Remove or rename the duplicate properties. |
39-
| <a id='BCP026' />BCP026 | Error | The output expects a value of type "{expectedType}" but the provided value is of type "{actualType}". |
39+
| <a id='BCP026' />BCP026 | Error | The output expects a value of type "{expectedType}", but the provided value is of type "{actualType}". |
4040
| <a id='BCP028' />BCP028 | Error | Identifier "{identifier}" is declared multiple times. Remove or rename the duplicates. |
4141
| <a id='BCP029' />BCP029 | Error | The resource type isn't valid. Specify a valid resource type of format "\<types>@\<apiVersion>". |
4242
| <a id='BCP030' />BCP030 | Error | The output type isn't valid. Specify one of the following types: {ToQuotedString(validTypes)}. |
4343
| <a id='BCP031' />BCP031 | Error | The parameter type isn't valid. Specify one of the following types: {ToQuotedString(validTypes)}. |
4444
| <a id='BCP032' />BCP032 | Error | The value must be a compile-time constant. |
45-
| <a id='BCP033' />[BCP033](./diagnostics/bcp033.md) | Error/Warning | Expected a value of type \<data-type> but the provided value is of type \<data-type>. |
45+
| <a id='BCP033' />[BCP033](./diagnostics/bcp033.md) | Error/Warning | Expected a value of type \<data-type>, but the provided value is of type \<data-type>. |
4646
| <a id='BCP034' />BCP034 | Error/Warning | The enclosing array expected an item of type "{expectedType}", but the provided item was of type "{actualType}". |
4747
| <a id='BCP035' />[BCP035](./diagnostics/bcp035.md) | Error/Warning | The specified \<data-type> declaration is missing the following required properties: \<property-name>. |
48-
| <a id='BCP036' />[BCP036](./diagnostics/bcp036.md) | Error/Warning | The property \<property-name> expected a value of type \<data-type> but the provided value is of type \<data-type>. |
48+
| <a id='BCP036' />[BCP036](./diagnostics/bcp036.md) | Error/Warning | The property \<property-name> expected a value of type \<data-type>, but the provided value is of type \<data-type>. |
4949
| <a id='BCP037' />[BCP037](./diagnostics/bcp037.md) | Error/Warning | The property \<property-name> isn't allowed on objects of type \<type-definition>. |
5050
| <a id='BCP040' />[BCP040](./diagnostics/bcp040.md) | Error/Warning | String interpolation isn't supported for keys on objects of type \<type-definition>. |
5151
| <a id='BCP041' />BCP041 | Error | Values of type "{valueType}" can't be assigned to a variable. |
@@ -55,7 +55,7 @@ If you need more information about a particular diagnostic code, select the **Fe
5555
| <a id='BCP046' />BCP046 | Error | Expected a value of type "{type}". |
5656
| <a id='BCP047' />BCP047 | Error | String interpolation is unsupported for specifying the resource type. |
5757
| <a id='BCP048' />[BCP048](./diagnostics/bcp048.md) | Error | Can't resolve function overload.|
58-
| <a id='BCP049' />BCP049 | Error | The array index must be of type "{LanguageConstants.String}" or "{LanguageConstants.Int}" but the provided index was of type "{wrongType}". |
58+
| <a id='BCP049' />BCP049 | Error | The array index must be of type "{LanguageConstants.String}" or "{LanguageConstants.Int}", but the provided index was of type "{wrongType}". |
5959
| <a id='BCP050' />BCP050 | Error | The specified path is empty. |
6060
| <a id='BCP051' />BCP051 | Error | The specified path begins with "/". Files must be referenced using relative paths. |
6161
| <a id='BCP052' />[BCP052](./diagnostics/bcp052.md) | Error/Warning | The type \<type-name> doesn't contain property \<property-name>. |
@@ -79,8 +79,8 @@ If you need more information about a particular diagnostic code, select the **Fe
7979
| <a id='BCP071' />[BCP071](./diagnostics/bcp071.md) | Error | Expected \<argument-count>, but got \<argument-count>. |
8080
| <a id='BCP072' />[BCP072](./diagnostics/bcp072.md) | Error | This symbol can't be referenced here. Only other parameters can be referenced in parameter default values. |
8181
| <a id='BCP073' />[BCP073](./diagnostics/bcp073.md) | Error/Warning | The property \<property-name> is read-only. Expressions can't be assigned to read-only properties. |
82-
| <a id='BCP074' />BCP074 | Error | Indexing over arrays requires an index of type "{LanguageConstants.Int}" but the provided index was of type "{wrongType}". |
83-
| <a id='BCP075' />BCP075 | Error | Indexing over objects requires an index of type "{LanguageConstants.String}" but the provided index was of type "{wrongType}". |
82+
| <a id='BCP074' />BCP074 | Error | Indexing over arrays requires an index of type "{LanguageConstants.Int}", but the provided index was of type "{wrongType}". |
83+
| <a id='BCP075' />BCP075 | Error | Indexing over objects requires an index of type "{LanguageConstants.String}", but the provided index was of type "{wrongType}". |
8484
| <a id='BCP076' />BCP076 | Error | Can't index over expression of type "{wrongType}". Arrays or objects are required. |
8585
| <a id='BCP077' />[BCP077](./diagnostics/bcp077.md) | Error/Warning | The property \<property-name> on type \<type-name> is write-only. Write-only properties can't be accessed. |
8686
| <a id='BCP078' />[BCP078](./diagnostics/bcp078.md) | Error/Warning | The property \<property-name> requires a value of type \<type-name>, but none was supplied. |
@@ -93,7 +93,7 @@ If you need more information about a particular diagnostic code, select the **Fe
9393
| <a id='BCP085' />BCP085 | Error | The specified file path contains one or more invalid path characters. The following aren't permitted: {ToQuotedString(forbiddenChars.OrderBy(x => x).Select(x => x.ToString()))}. |
9494
| <a id='BCP086' />BCP086 | Error | The specified file path ends with an invalid character. The following aren't permitted: {ToQuotedString(forbiddenPathTerminatorChars.OrderBy(x => x).Select(x => x.ToString()))}. |
9595
| <a id='BCP087' />BCP087 | Error | Array and object literals aren't allowed here. |
96-
| <a id='BCP088' />[BCP088](./diagnostics/bcp088.md) | Error/Warning | The property \<property-name> expected a value of type \<type-name> but the provided value is of type \<type-name>. Did you mean \<type-name>? |
96+
| <a id='BCP088' />[BCP088](./diagnostics/bcp088.md) | Error/Warning | The property \<property-name> expected a value of type \<type-name>, but the provided value is of type \<type-name>. Did you mean \<type-name>? |
9797
| <a id='BCP089' />[BCP089](./diagnostics/bcp089.md) | Error/Warning | The property \<property-name> isn't allowed on objects of type \<resource-type>. Did you mean \<property-name>? |
9898
| <a id='BCP090' />BCP090 | Error | This module declaration is missing a file path reference. |
9999
| <a id='BCP091' />BCP091 | Error | An error occurred reading file. {failureMessage} |
@@ -141,7 +141,7 @@ If you need more information about a particular diagnostic code, select the **Fe
141141
| <a id='BCP134' />BCP134 | Error | Scope \<scope-name> isn't valid for this module. Permitted scopes: \<scope-name>. |
142142
| <a id='BCP135' />[BCP135](./diagnostics/bcp135.md) | Error | Scope \<scope-name> isn't valid for this resource type. Permitted scopes: \<scope-name>. |
143143
| <a id='BCP136' />BCP136 | Error | Expected a loop item variable identifier at this location. |
144-
| <a id='BCP137' />BCP137 | Error | Loop expected an expression of type "{LanguageConstants.Array}" but the provided value is of type "{actualType}". |
144+
| <a id='BCP137' />BCP137 | Error | Loop expected an expression of type "{LanguageConstants.Array}", but the provided value is of type "{actualType}". |
145145
| <a id='BCP138' />BCP138 | Error | For-expressions aren't supported in this context. For-expressions may be used as values of resource, module, variable, and output declarations, or values of resource and module properties. |
146146
| <a id='BCP083' />[BCP139](./diagnostics/bcp139.md) | Error | A resource's scope must match the scope of the Bicep file for it to be deployable. You must use modules to deploy resources to a different scope. |
147147
| <a id='BCP140' />BCP140 | Error | The multi-line string at this location isn't terminated. Terminate it with "'''. |
@@ -157,7 +157,7 @@ If you need more information about a particular diagnostic code, select the **Fe
157157
| <a id='BCP151' />BCP151 | Error | Expected an output declaration after the decorator. |
158158
| <a id='BCP152' />[BCP152](./diagnostics/bcp152.md) | Error | Function \<function-name> can't be used as a decorator. |
159159
| <a id='BCP153' />[BCP153](./diagnostics/bcp153.md) | Error | Expected a resource or module declaration after the decorator. |
160-
| <a id='BCP154' />BCP154 | Error | Expected a batch size of at least {limit} but the specified value was "{value}". |
160+
| <a id='BCP154' />BCP154 | Error | Expected a batch size of at least {limit}, but the specified value was "{value}". |
161161
| <a id='BCP155' />BCP155 | Error | The decorator \<decorator-name> can only be attached to resource or module collections. |
162162
| <a id='BCP156' />BCP156 | Error | The resource type segment "{typeSegment}" is invalid. Nested resources must specify a single type segment, and optionally can specify an API version using the format "\<type>@\<apiVersion>". |
163163
| <a id='BCP157' />BCP157 | Error | The resource type can't be determined due to an error in the containing resource. |
@@ -198,7 +198,7 @@ If you need more information about a particular diagnostic code, select the **Fe
198198
| <a id='BCP195' />BCP195 | Error | {BuildInvalidOciArtifactReferenceClause(aliasName, badRef)} The artifact path segment "{badSegment}" isn't valid. Each artifact name path segment must be a lowercase alphanumeric string optionally separated by a ".", "_", or \"-\"." |
199199
| <a id='BCP196' />BCP196 | Error | The module tag or digest is missing. |
200200
| <a id='BCP197' />BCP197 | Error | The tag "{badTag}" exceeds the maximum length of {maxLength} characters. |
201-
| <a id='BCP198' />BCP198 | Error | The tag "{badTag}" isn't valid. Valid characters are alphanumeric, ".", "_", or "-" but the tag can't begin with ".", "_", or "-". |
201+
| <a id='BCP198' />BCP198 | Error | The tag "{badTag}" isn't valid. Valid characters are alphanumeric, ".", "_", or "-", but the tag can't begin with ".", "_", or "-". |
202202
| <a id='BCP199' />BCP199 | Error | Module path "{badRepository}" exceeds the maximum length of {maxLength} characters. |
203203
| <a id='BCP200' />BCP200 | Error | The registry "{badRegistry}" exceeds the maximum length of {maxLength} characters. |
204204
| <a id='BCP201' />[BCP201](./diagnostics/bcp201.md) | Error | Expected an extension specification string. This should either be a relative path, or a valid OCI artifact specification. |
@@ -254,7 +254,7 @@ If you need more information about a particular diagnostic code, select the **Fe
254254
| <a id='BCP257' />BCP257 | Error | Expected a Bicep file path string. This should be a relative path to another Bicep file, e.g. 'myModule.bicep' or '../parent/myModule.bicep' |
255255
| <a id='BCP258' />BCP258 | Warning | The following parameters are declared in the Bicep file but are missing an assignment in the params file: {ToQuotedString(identifiers)}. |
256256
| <a id='BCP259' />BCP259 | Error | The parameter "{identifier}" is assigned in the params file without being declared in the Bicep file. |
257-
| <a id='BCP260' />BCP260 | Error | The parameter "{identifier}" expects a value of type "{expectedType}" but the provided value is of type "{actualType}". |
257+
| <a id='BCP260' />BCP260 | Error | The parameter "{identifier}" expects a value of type "{expectedType}", but the provided value is of type "{actualType}". |
258258
| <a id='BCP261' />BCP261 | Error | A using declaration must be present in this parameters file. |
259259
| <a id='BCP262' />BCP262 | Error | More than one using declaration is present. |
260260
| <a id='BCP263' />BCP263 | Error | The file specified in the using declaration path doesn't exist. |
@@ -305,7 +305,7 @@ If you need more information about a particular diagnostic code, select the **Fe
305305
| <a id='BCP318' />BCP318 | Warning | The value of type "{possiblyNullType}" may be null at the start of the deployment, which would cause this access expression (and the overall deployment with it) to fail. If you don't know whether the value will be null and the template would handle a null value for the overall expression, use a `.?` (safe dereference) operator to short-circuit the access expression if the base expression's value is null: {accessExpression.AsSafeAccess().ToString()}. If you know the value won't be null, use a non-null assertion operator to inform the compiler that the value won't be null: {SyntaxFactory.AsNonNullable(expression).ToString()}. |
306306
| <a id='BCP319' />BCP319 | Error | The type at "{errorSource}" couldn't be resolved by the ARM JSON template engine. Original error message: "{message}" |
307307
| <a id='BCP320' />BCP320 | Error | The properties of module output resources can't be accessed directly. To use the properties of this resource, pass it as a resource-typed parameter to another module and access the parameter's properties therein. |
308-
| <a id='BCP321' />BCP321 | Warning | Expected a value of type "{expectedType}" but the provided value is of type "{actualType}". If you know the value won't be null, use a non-null assertion operator to inform the compiler that the value won't be null: {SyntaxFactory.AsNonNullable(expression).ToString()}. |
308+
| <a id='BCP321' />BCP321 | Warning | Expected a value of type "{expectedType}", but the provided value is of type "{actualType}". If you know the value won't be null, use a non-null assertion operator to inform the compiler that the value won't be null: {SyntaxFactory.AsNonNullable(expression).ToString()}. |
309309
| <a id='BCP322' />BCP322 | Error | The `.?` (safe dereference) operator may not be used on instance function invocations. |
310310
| <a id='BCP323' />BCP323 | Error | The `[?]` (safe dereference) operator may not be used on resource or module collections. |
311311
| <a id='BCP325' />BCP325 | Error | Expected a type identifier at this location. |
@@ -386,4 +386,4 @@ If you need more information about a particular diagnostic code, select the **Fe
386386

387387
## Next steps
388388

389-
To learn about Bicep, see [Bicep overview](./overview.md).
389+
See the [What is Bicep?](./overview.md) overview to learn more about Bicep.

0 commit comments

Comments
 (0)