Bicep diagnostic code - BCP036
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.
Description
The property <property-name> expected a value of type <data-type> but the provided value is of type <data-type>.
Level
Warning / Error
Solution
Assign a value with the correct data type.
Examples
The following example raises the diagnostic because sku
is defined as a string, not an integer:
type storageAccountConfigType = {
name: string
sku: string
}
param foo storageAccountConfigType = {
name: 'myStorage'
sku: 2
}
You can fix the issue by assigning a string value to sku
:
type storageAccountConfigType = {
name: string
sku: string
}
param foo storageAccountConfigType = {
name: 'myStorage'
sku: 'Standard_LRS'
}
Next steps
For more information about Bicep diagnostics, see Bicep core diagnostics.