Skip to content

Commit 795bf82

Browse files
authored
Merge pull request #295040 from mumian/2020-bcp-070
Add bcp070 and bcp048
2 parents 837b8a0 + 2745d08 commit 795bf82

File tree

4 files changed

+89
-3
lines changed

4 files changed

+89
-3
lines changed

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

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

99
# Bicep core diagnostics
@@ -54,7 +54,7 @@ If you need more information about a particular diagnostic code, select the **Fe
5454
| <a id='BCP045' />BCP045 | Error | Can't apply operator "{operatorName}" to operands of type "{type1}" and "{type2}".{(additionalInfo is null? string.Empty : " " + additionalInfo)} |
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. |
57-
| <a id='BCP048' />BCP048 | Error | Can't resolve function overload. For details, see the documentation. |
57+
| <a id='BCP048' />[BCP048](./diagnostics/bcp048.md) | Error | Can't resolve function overload.|
5858
| <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. |
@@ -75,7 +75,7 @@ If you need more information about a particular diagnostic code, select the **Fe
7575
| <a id='BCP067' />BCP067 | Error | Can't call functions on type "{wrongType}". An "{LanguageConstants.Object}" type is required. |
7676
| <a id='BCP068' />BCP068 | Error | Expected a resource type string. Specify a valid resource type of format "\<types>@\<apiVersion>". |
7777
| <a id='BCP069' />BCP069 | Error | The function "{function}" isn't supported. Use the "{@operator}" operator instead. |
78-
| <a id='BCP070' />BCP070 | Error | Argument of type "{argumentType}" isn't assignable to parameter of type "{parameterType}". |
78+
| <a id='BCP070' />[BCP070](./diagnostics/bcp070.md) | Error | Argument of type \<argument-type> isn't assignable to parameter of type \<parameter-type>. |
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. |
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: BCP048
3+
description: Can't resolve function overload.
4+
ms.topic: reference
5+
ms.custom: devx-track-bicep
6+
ms.date: 02/12/2025
7+
---
8+
9+
# Bicep diagnostic code - BCP048
10+
11+
This diagnostic occurs when a function has two or more possible signatures, but the input provided doesn't match any of them.
12+
13+
## Description
14+
15+
Can't resolve function overload.
16+
17+
## Level
18+
19+
Error
20+
21+
## Solution
22+
23+
Ensure that the argument passed to the function matches one of the expected types defined in its overload signatures.
24+
25+
## Examples
26+
27+
The following example raises the diagnostic because the [`length()`](../bicep-functions-string.md#contains) function requires its argument to be a string, an object, or an array.
28+
29+
```bicep
30+
output stringLength int = length(3)
31+
```
32+
33+
You can fix the issue by providing an argument that matches the required argument type:
34+
35+
```bicep
36+
output stringLength int = length('three')
37+
```
38+
39+
## Next steps
40+
41+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: BCP070
3+
description: Argument of type <argument-type> isn't assignable to parameter of type <parameter-type>.
4+
ms.topic: reference
5+
ms.custom: devx-track-bicep
6+
ms.date: 02/20/2025
7+
---
8+
9+
# Bicep diagnostic code - BCP070
10+
11+
This diagnostic occurs when a function is given an argument with the wrong data type.
12+
13+
## Description
14+
15+
Argument of type \<argument-type> isn't assignable to parameter of type \<parameter-type>.
16+
17+
## Level
18+
19+
Error
20+
21+
## Solution
22+
23+
Provide a parameter with the correct data type.
24+
25+
## Examples
26+
27+
The following example raises the diagnostic because the [`contains()`](../bicep-functions-string.md#contains) function, when used with a string as its first argument, requires a string as its second argument, but an integer was provided instead:
28+
29+
```bicep
30+
output stringTrue bool = contains('OneTwoThree', 2)
31+
```
32+
33+
You can fix the diagnostic by using a string as its second argument:
34+
35+
```bicep
36+
output stringTrue bool = contains('OneTwoThree', 'Two')
37+
```
38+
39+
## Next steps
40+
41+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,8 @@
633633
href: diagnostics/bcp037.md
634634
- name: BCP040
635635
href: diagnostics/bcp040.md
636+
- name: BCP048
637+
href: diagnostics/bcp048.md
636638
- name: BCP052
637639
href: diagnostics/bcp052.md
638640
- name: BCP053
@@ -645,6 +647,8 @@
645647
href: diagnostics/bcp062.md
646648
- name: BCP063
647649
href: diagnostics/bcp063.md
650+
- name: BCP070
651+
href: diagnostics/bcp070.md
648652
- name: BCP071
649653
href: diagnostics/bcp071.md
650654
- name: BCP072

0 commit comments

Comments
 (0)