Bicep diagnostic code - BCP070

This diagnostic occurs when a function is given an argument with the wrong data type.

Description

Argument of type <argument-type> isn't assignable to parameter of type <parameter-type>.

Level

Error

Solution

Provide a parameter with the correct data type.

Examples

The following example raises the diagnostic because the contains() function, when used with a string as its first argument, requires a string as its second argument, but an integer was provided instead:

Bicep
output stringTrue bool = contains('OneTwoThree', 2)

You can fix the diagnostic by using a string as its second argument:

Bicep
output stringTrue bool = contains('OneTwoThree', 'Two')

Next steps

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