Skip to content

Commit e27fa5d

Browse files
Merge pull request #288258 from mumian/main
restructure the diagnostic files
2 parents 727948b + bebb3a1 commit e27fa5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+595
-399
lines changed
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
---
22
title: BCP007
3-
description: Error - This declaration type isn't recognized. Specify a metadata, parameter, variable, resource, or output declaration.
3+
description: This declaration type isn't recognized. Specify a metadata, parameter, variable, resource, or output declaration.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
66
ms.date: 08/23/2024
77
---
88

9-
# Bicep error code - BCP007
9+
# Bicep diagnostic code - BCP007
1010

11-
This error occurs when the declaration type isn't recognized. For a list of declaration types, see [Understand the structure and syntax of Bicep files](../file.md).
11+
This diagnostic occurs when the declaration type isn't recognized. For a list of declaration types, see [Understand the structure and syntax of Bicep files](../file.md).
1212

13-
## Error description
13+
## Description
1414

15-
`This declaration type isn't recognized. Specify a metadata, parameter, variable, resource, or output declaration.`
15+
This declaration type isn't recognized. Specify a metadata, parameter, variable, resource, or output declaration.
16+
17+
## Level
18+
19+
Error
1620

1721
## Solution
1822

1923
Use the correct declaration type. For more information, see [Bicep file](../file.md).
2024

2125
## Examples
2226

23-
The following example raises the error because `parameter` isn't a correct declaration type:
27+
The following example raises the diagnostic because `parameter` isn't a correct declaration type:
2428

2529
```bicep
2630
parameter name string
2731
```
2832

29-
You can fix the error by using the correct declaration type, `param`.
33+
You can fix the diagnostic by using the correct declaration type, `param`.
3034

3135
```bicep
3236
param name string
@@ -36,4 +40,4 @@ For more information, see [Parameters](../parameters.md).
3640

3741
## Next steps
3842

39-
For more information about Bicep error and warning codes, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
43+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
---
22
title: BCP009
3-
description: Error - Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location.
3+
description: Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
66
ms.date: 08/23/2024
77
---
88

9-
# Bicep error code - BCP009
9+
# Bicep diagnostic code - BCP009
1010

11-
This error occurs when a declaration is not completed.
11+
This diagnostic occurs when a declaration is not completed.
1212

13-
## Error description
13+
## Description
1414

15-
`Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location.`
15+
Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location.
16+
17+
## Level
18+
19+
Error
1620

1721
## Solution
1822

1923
Include the missing part. For more information, see [Bicep file](../file.md).
2024

2125
## Examples
2226

23-
The following example raises the error because the `metadata` declaration isn't completed:
27+
The following example raises the diagnostic because the `metadata` declaration isn't completed:
2428

2529
```bicep
2630
metadata description =
2731
```
2832

29-
You can fix the error by using completing the declaration.
33+
You can fix the diagnostic by using completing the declaration.
3034

3135
```bicep
3236
metadata description = 'Creates a storage account and a web app'
@@ -36,4 +40,4 @@ For more information, see [Metadata](../file.md#metadata).
3640

3741
## Next steps
3842

39-
For more information about Bicep error and warning codes, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
43+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
---
22
title: BCP018
3-
description: Error - Expected the <character> character at this location.
3+
description: Expected the <character> character at this location.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
66
ms.date: 08/08/2024
77
---
88

9-
# Bicep error code - BCP018
9+
# Bicep diagnostic code - BCP018
1010

11-
This error occurs when a character, such as a bracket, is missing.
11+
This diagnostic occurs when a character, such as a bracket, is missing.
1212

13-
## Error description
13+
## Description
1414

15-
`Expected the <character> character at this location.`
15+
Expected the \<character> character at this location.
16+
17+
## Level
18+
19+
Error
1620

1721
## Solution
1822

1923
Add the missing character.
2024

2125
## Examples
2226

23-
The following example raises the error because the code is missing a _}_.
27+
The following example raises the diagnostic because the code is missing a _}_.
2428

2529
```bicep
2630
output tennisBall object = {
2731
type: 'tennis'
2832
color: 'yellow'
2933
```
3034

31-
You can fix the error by adding the missing _}_.
35+
You can fix the diagnostic by adding the missing _}_.
3236

3337
```bicep
3438
output tennisBall object = {
@@ -39,7 +43,7 @@ output tennisBall object = {
3943

4044
For more information, see [Objects](../data-types.md#objects)
4145

42-
The following example raises the error because the code is missing a _]_.
46+
The following example raises the diagnostic because the code is missing a _]_.
4347

4448
```bicep
4549
output colors array = [
@@ -48,7 +52,7 @@ output colors array = [
4852
'white'
4953
```
5054

51-
You can fix the error by adding the missing _]_.
55+
You can fix the diagnostic by adding the missing _]_.
5256

5357
```bicep
5458
output colors array = [
@@ -60,13 +64,13 @@ output colors array = [
6064

6165
For more information, see [Arrays](../data-types.md#arrays).
6266

63-
The following example raises the error because the code is missing `=` and the assigned value.
67+
The following example raises the diagnostic because the code is missing `=` and the assigned value.
6468

6569
```bicep
6670
output month int
6771
```
6872

69-
You can fix the error by completing the output declaration.
73+
You can fix the diagnostic by completing the output declaration.
7074

7175
```bicep
7276
output month int = 3
@@ -76,4 +80,4 @@ For more information, see [Outputs](../file.md#outputs).
7680

7781
## Next steps
7882

79-
For more information about Bicep error and warning codes, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
83+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
---
22
title: BCP033
3-
description: Error/warning - Expected a value of type <data-type> but the provided value is of type <data-type>.
3+
description: Expected a value of type <data-type> but the provided value is of type <data-type>.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 07/15/2024
6+
ms.date: 10/10/2024
77
---
88

9-
# Bicep error/warning code - BCP033
9+
# Bicep diagnostic code - BCP033
1010

11-
This error/warning occurs when you assign a value of a mismatched data type.
11+
This diagnostic occurs when you assign a value of a mismatched data type.
1212

13-
## Error/warning description
13+
## Description
1414

15-
`Expected a value of type <data-type> but the provided value is of type <data-type>.`
15+
Expected a value of type \<data-type> but the provided value is of type \<data-type>.
16+
17+
## Level
18+
19+
Warning / Error
1620

1721
## Solution
1822

19-
Use the expected data type.
23+
Use the expected data type. If the provided value is a token, enclose it in the [any() function](../bicep-functions-any.md) to mitigate the issue.
2024

2125
## Examples
2226

23-
The following example raises the error because the expected data type is a string. The actual provided value is an integer:
27+
The following example raises the diagnostic because the expected data type is a string. The actual provided value is an integer:
2428

2529
```bicep
2630
var myValue = 5
2731
2832
output myString string = myValue
2933
```
3034

31-
You can fix the error by providing a string value:
35+
You can fix the diagnostic by providing a string value:
3236

3337
```bicep
3438
var myValue = '5'
@@ -38,4 +42,4 @@ output myString string = myValue
3842

3943
## Next steps
4044

41-
For more information about Bicep error and warning codes, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
45+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
---
22
title: BCP035
3-
description: Error/warning - The specified <data-type> declaration is missing the following required properties <property-name>.
3+
description: The specified <data-type> declaration is missing the following required properties <property-name>.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
66
ms.date: 07/15/2024
77
---
88

9-
# Bicep error/warning code - BCP035
9+
# Bicep diagnostic code - BCP035
1010

11-
This error/warning occurs when your resource definition is missing a required property.
11+
This diagnostic occurs when your resource definition is missing a required property.
1212

13-
## Error/warning description
13+
## Description
1414

15-
`The specified <date-type> declaration is missing the following required properties: <property-name>.`
15+
The specified \<date-type> declaration is missing the following required properties: \<property-name>.
16+
17+
## Level
18+
19+
Warning / Error
1620

1721
## Solution
1822

1923
Add the missing property to the resource definition.
2024

2125
## Examples
2226

23-
The following example raises the warning for _virtualNetworkGateway1_ and _virtualNetworkGateway2_:
27+
The following example raises the diagnostic for _virtualNetworkGateway1_ and _virtualNetworkGateway2_:
2428

2529
```bicep
2630
var networkConnectionName = 'testConnection'
@@ -44,13 +48,13 @@ resource networkConnection 'Microsoft.Network/connections@2023-11-01' = {
4448
}
4549
```
4650

47-
The warning is:
51+
The diagnostic is:
4852

49-
```warning
53+
```diagnostic
5054
The specified "object" declaration is missing the following required properties: "properties". If this is an inaccuracy in the documentation, please report it to the Bicep Team.
5155
```
5256

53-
You can verify the missing properties from the [template reference](/azure/templates). If you see the warning from Visual Studio Code, hover the cursor over the resource symbolic name and select **View document** to open the template reference.
57+
You can verify the missing properties from the [template reference](/azure/templates). If you see the diagnostic from Visual Studio Code, hover the cursor over the resource symbolic name and select **View document** to open the template reference.
5458

5559
You can fix the issue by adding the missing properties:
5660

@@ -78,7 +82,7 @@ resource networkConnection 'Microsoft.Network/connections@2023-11-01' = {
7882
}
7983
```
8084

81-
The following example raises the error for _outValue_ because the required property _value_ is missing:
85+
The following example raises the diagnostic for _outValue_ because the required property _value_ is missing:
8286

8387
```bicep
8488
@discriminator('type')
@@ -98,4 +102,4 @@ output outValue taggedUnion = {type: 'foo', value: 3}
98102

99103
## Next steps
100104

101-
For more information about Bicep error and warning codes, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
105+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
---
22
title: BCP036
3-
description: Error/warning - The property <property-name> expected a value of type <data-type> but the provided value is of type <data-type>.
3+
description: The property <property-name> expected a value of type <data-type> but the provided value is of type <data-type>.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
66
ms.date: 07/15/2024
77
---
88

9-
# Bicep error/warning code - BCP036
9+
# Bicep diagnostic code - BCP036
1010

11-
This error/warning occurs when you assign a value to a property whose expected data type isn't compatible with the type of the assigned value.
11+
This diagnostic occurs when you assign a value to a property whose expected data type isn't compatible with the type of the assigned value.
1212

13-
## Error/warning description
13+
## Description
1414

15-
`The property <property-name> expected a value of type <data-type> but the provided value is of type <data-type>.`
15+
The property \<property-name> expected a value of type \<data-type> but the provided value is of type \<data-type>.
16+
17+
## Level
18+
19+
Warning / Error
1620

1721
## Solution
1822

1923
Assign a value with the correct data type.
2024

2125
## Examples
2226

23-
The following example raises the error because `sku` is defined as a string, not an integer:
27+
The following example raises the diagnostic because `sku` is defined as a string, not an integer:
2428

2529
```bicep
2630
type storageAccountConfigType = {
@@ -50,4 +54,4 @@ param foo storageAccountConfigType = {
5054

5155
## Next steps
5256

53-
For more information about Bicep error and warning codes, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
57+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).

0 commit comments

Comments
 (0)