Rediger

Del via


Bicep diagnostic code - BCP033

This diagnostic occurs when you assign a value of a mismatched data type.

Description

Expected a value of type <data-type> but the provided value is of type <data-type>.

Level

Warning / Error

Solution

Use the expected data type. If the provided value is a token, enclose it in the any() function to mitigate the issue.

Examples

The following example raises the diagnostic because the expected data type is a string. The actual provided value is an integer:

var myValue = 5

output myString string = myValue

You can fix the diagnostic by providing a string value:

var myValue = '5'

output myString string = myValue

Next steps

For more information about Bicep diagnostics, see Bicep core diagnostics.