Skip to content

Commit 9f7e354

Browse files
committed
Add BCP052, 077, 078, 083, 088, 089
1 parent 2607406 commit 9f7e354

File tree

9 files changed

+190
-12
lines changed

9 files changed

+190
-12
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ If you need more information about a particular diagnostic code, select the **Fe
5858
| BCP049 | Error | The array index must be of type "{LanguageConstants.String}" or "{LanguageConstants.Int}" but the provided index was of type "{wrongType}". |
5959
| BCP050 | Error | The specified path is empty. |
6060
| BCP051 | Error | The specified path begins with "/". Files must be referenced using relative paths. |
61-
| <a id='BCP052' />[BCP052](./diagnostics/bcp052.md) | Error/Warning | The type <type-name> does not contain property <property-name>. |
62-
| <a id='BCP053' />[BCP053](./diagnostics/bcp053.md) | Error/Warning | The type <type-name> does not contain property <property-name>. Available properties include <property-names>. |
61+
| <a id='BCP052' />[BCP052](./diagnostics/bcp052.md) | Error/Warning | The type \<type-name> does not contain property \<property-name>. |
62+
| <a id='BCP053' />[BCP053](./diagnostics/bcp053.md) | Error/Warning | The type \<type-name> does not contain property \<property-name>. Available properties include \<property-names>. |
6363
| BCP054 | Error | The type "{type}" does not contain any properties. |
6464
| BCP055 | Error | Cannot access properties of type "{wrongType}". An "{LanguageConstants.Object}" type is required. |
6565
| BCP056 | Error | The reference to name "{name}" is ambiguous because it exists in namespaces {ToQuotedString(namespaces)}. The reference must be fully qualified. |
@@ -82,19 +82,19 @@ If you need more information about a particular diagnostic code, select the **Fe
8282
| BCP074 | Error | Indexing over arrays requires an index of type "{LanguageConstants.Int}" but the provided index was of type "{wrongType}". |
8383
| BCP075 | Error | Indexing over objects requires an index of type "{LanguageConstants.String}" but the provided index was of type "{wrongType}". |
8484
| BCP076 | Error | Cannot index over expression of type "{wrongType}". Arrays or objects are required. |
85-
| <a id='BCP077' />[BCP077](./diagnostics/bcp077.md) | Error/Warning | The property <property-name> on type <type-name> is write-only. Write-only properties cannot be accessed. |
86-
| BCP078 | Error/Warning | The property "{propertyName}" requires a value of type "{expectedType}", but none was supplied. |
85+
| <a id='BCP077' />[BCP077](./diagnostics/bcp077.md) | Error/Warning | The property \<property-name> on type \<type-name> is write-only. Write-only properties cannot be accessed. |
86+
| <a id='BCP078' />[BCP078](./diagnostics/bcp078.md) | Error/Warning | The property \<property-name> requires a value of type \<type-name>, but none was supplied. |
8787
| BCP079 | Error | This expression is referencing its own declaration, which is not allowed. |
8888
| BCP080 | Error | The expression is involved in a cycle ("{string.Join("\" -> \"", cycle)}"). |
8989
| BCP081 | Warning | Resource type "{resourceTypeReference.FormatName()}" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed. |
9090
| BCP082 | Error | The name "{name}" does not exist in the current context. Did you mean "{suggestedName}"? |
91-
| BCP083 | Error/Warning | The type "{type}" does not contain property "{badProperty}". Did you mean "{suggestedProperty}"? |
91+
| <a id='BCP083' />[BCP083](./diagnostics/bcp083.md) | Error/Warning | The type \<type-definition> does not contain property \<property-name>. Did you mean \<property-name>? |
9292
| BCP084 | Error | The symbolic name "{name}" is reserved. Please use a different symbolic name. Reserved namespaces are {ToQuotedString(namespaces.OrderBy(ns => ns))}. |
9393
| BCP085 | Error | The specified file path contains one ore more invalid path characters. The following are not permitted: {ToQuotedString(forbiddenChars.OrderBy(x => x).Select(x => x.ToString()))}. |
9494
| BCP086 | Error | The specified file path ends with an invalid character. The following are not permitted: {ToQuotedString(forbiddenPathTerminatorChars.OrderBy(x => x).Select(x => x.ToString()))}. |
9595
| BCP087 | Error | Array and object literals are not allowed here. |
96-
| BCP088 | Error/Warning | The property "{property}" expected a value of type "{expectedType}" but the provided value is of type "{actualStringLiteral}". Did you mean "{suggestedStringLiteral}"? |
97-
| BCP089 | Error/Warning | The property "{property}" is not allowed on objects of type "{type}". Did you mean "{suggestedProperty}"? |
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>? |
97+
| <a id='BCP089' />[BCP089](./diagnostics/bcp089.md) | Error/Warning | The property \<property-name> is not allowed on objects of type \<resource-type>. Did you mean \<property-name>? |
9898
| BCP090 | Error | This module declaration is missing a file path reference. |
9999
| BCP091 | Error | An error occurred reading file. {failureMessage} |
100100
| BCP092 | Error | String interpolation is not supported in file paths. |

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Add the missing property to the resource definition.
2020

2121
## Examples
2222

23-
The following example raises the warning for **virtualNetworkGateway1** and **virtualNetworkGateway2**:
23+
The following example raises the warning for _virtualNetworkGateway1_ and _virtualNetworkGateway2_:
2424

2525
```bicep
2626
var networkConnectionName = 'testConnection'
@@ -78,6 +78,24 @@ resource networkConnection 'Microsoft.Network/connections@2023-11-01' = {
7878
}
7979
```
8080

81+
The following example raises the error for _outValue_ because the required property _value_ is missing:
82+
83+
```bicep
84+
@discriminator('type')
85+
type taggedUnion = {type: 'foo', value: int} | {type: 'bar', value: bool}
86+
87+
output outValue taggedUnion = {type: 'foo'}
88+
```
89+
90+
You can fix the issue by adding the missing properties:
91+
92+
```bicep
93+
@discriminator('type')
94+
type taggedUnion = {type: 'foo', value: int} | {type: 'bar', value: bool}
95+
96+
output outValue taggedUnion = {type: 'foo', value: 3}
97+
```
98+
8199
## Next steps
82100

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

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 08/06/2024
88

99
# Bicep error/warning code - BCP052
1010

11-
This error/warning occurs when you reference a property that isn't defined in the [data type](../data-types.md).
11+
This error/warning occurs when you reference a property that isn't defined in the [data type](../data-types.md) or the [user-defined data type]().
1212

1313
## Error/warning description
1414

@@ -19,7 +19,13 @@ This error/warning occurs when you reference a property that isn't defined in th
1919
The following example raises the error _object_ doesn't contain a property called _bar_:
2020

2121
```bicep
22-
type missingProperty = object.bar
22+
type foo = object.bar
23+
```
24+
25+
You can fix the error by removing the property:
26+
27+
```bicep
28+
type foo = object
2329
```
2430

2531
## Next steps

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This error/warning occurs when you reference a property that is write-only.
1616

1717
## Examples
1818

19-
The following example raises the warning because `customHeaders` is write-only.
19+
The following example raises the warning because `customHeaders` is a write-only property.
2020

2121
```bicep
2222
resource webhook 'Microsoft.ContainerRegistry/registries/webhooks@2023-07-01' existing = {

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This error/warning occurs when you reference a [custom-tagged union data type](.
1616

1717
## Examples
1818

19-
The following example raises the error because neither _`foo`_ nor `_bar_` is provided.
19+
The following example raises the error because the property _type_ with the value of _`foo`_ or `_bar_` isn't provided.
2020

2121
```bicep
2222
@discriminator('type')
@@ -25,6 +25,17 @@ type taggedUnion = {type: 'foo', value: int} | {type: 'bar', value: bool}
2525
output outValue taggedUnion = {}
2626
```
2727

28+
You can fix the error by including the properties:
29+
30+
```bicep
31+
@discriminator('type')
32+
type taggedUnion = {type: 'foo', value: int} | {type: 'bar', value: bool}
33+
34+
output outValue taggedUnion = {type: 'foo', value: 3}
35+
```
36+
37+
If the property _value_ is not provided in the preceding example, you will get [BCP035](./bcp035.md).
38+
2839
## Next steps
2940

3041
For more information about Bicep error and warning codes, see [Bicep warnings and errors](../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: BCP083
3+
description: Error/warning - The type <type-definition> does not contain property <property-name>. Did you mean <property-name>?
4+
ms.topic: reference
5+
ms.custom: devx-track-bicep
6+
ms.date: 08/06/2024
7+
---
8+
9+
# Bicep error/warning code - BCP083
10+
11+
This error/warning occurs when you reference a property of a type that appears to be a typo.
12+
13+
## Error/warning description
14+
15+
`The type <type-definition> does not contain property <property-name>. Did you mean <property-name>?`
16+
17+
## Examples
18+
19+
The following example raises the error because _foo.type1_ looks like a typo.
20+
21+
```bicep
22+
type foo = {
23+
type: string
24+
}
25+
26+
type bar = foo.type1
27+
```
28+
29+
You can fix the error by correcting the typo:
30+
31+
```bicep
32+
type foo = {
33+
type: string
34+
}
35+
36+
type bar = foo.type
37+
```
38+
39+
## Next steps
40+
41+
For more information about Bicep error and warning codes, see [Bicep warnings and errors](../bicep-core-diagnostics.md).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: BCP088
3+
description: 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>?
4+
ms.topic: reference
5+
ms.custom: devx-track-bicep
6+
ms.date: 08/06/2024
7+
---
8+
9+
# Bicep error/warning code - BCP088
10+
11+
This error/warning occurs when a value of a property seems to be a typo.
12+
13+
## Error/warning description
14+
15+
`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>?`
16+
17+
## Examples
18+
19+
The following example raises the error because _name_ value _ad_ looks like a typo.
20+
21+
```bicep
22+
resource kv 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
23+
name: 'vault'
24+
25+
resource ap 'accessPolicies' = {
26+
name: 'ad'
27+
properties: {
28+
accessPolicies: []
29+
}
30+
}
31+
}
32+
```
33+
34+
You can fix the error by correcting the typo:
35+
36+
```bicep
37+
resource kv 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
38+
name: 'vault'
39+
40+
resource ap 'accessPolicies' = {
41+
name: 'add'
42+
properties: {
43+
accessPolicies: []
44+
}
45+
}
46+
}
47+
```
48+
49+
## Next steps
50+
51+
For more information about Bicep error and warning codes, see [Bicep warnings and errors](../bicep-core-diagnostics.md).
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: BCP089
3+
description: Error/warning - The property <property-name> is not allowed on objects of type <resource-type>. Did you mean <property-name>?
4+
ms.topic: reference
5+
ms.custom: devx-track-bicep
6+
ms.date: 08/06/2024
7+
---
8+
9+
# Bicep error/warning code - BCP089
10+
11+
This error/warning occurs when a property name seems to be a typo.
12+
13+
## Error/warning description
14+
15+
`The property <property-name> is not allowed on objects of type <resource-type>. Did you mean <property-name>?`
16+
17+
## Examples
18+
19+
The following example raises the error because the property name _named_ looks like a typo.
20+
21+
```bicep
22+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = {
23+
named: 'account'
24+
}
25+
```
26+
27+
You can fix the error by correcting the typo:
28+
29+
```bicep
30+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = {
31+
name: 'account'
32+
}
33+
```
34+
35+
## Next steps
36+
37+
For more information about Bicep error and warning codes, see [Bicep warnings and errors](../bicep-core-diagnostics.md).

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,24 @@
617617
href: diagnostics/bcp037.md
618618
- name: BCP040
619619
href: diagnostics/bcp040.md
620+
- name: BCP052
621+
href: diagnostics/bcp052.md
622+
- name: BCP053
623+
href: diagnostics/bcp053.md
620624
- name: BCP072
621625
href: diagnostics/bcp072.md
622626
- name: BCP073
623627
href: diagnostics/bcp073.md
628+
- name: BCP077
629+
href: diagnostics/bcp077.md
630+
- name: BCP078
631+
href: diagnostics/bcp078.md
632+
- name: BCP083
633+
href: diagnostics/bcp083.md
634+
- name: BCP088
635+
href: diagnostics/bcp088.md
636+
- name: BCP089
637+
href: diagnostics/bcp089.md
624638
- name: BCP327
625639
href: diagnostics/bcp327.md
626640
- name: BCP328

0 commit comments

Comments
 (0)