Bicep error/warning code - BCP332

This error/warning occurs when a string or array exceeding the allowable length is assigned.

Error/warning description

The provided value (whose length will always be greater than or equal to <length>) is too long to assign to a target for which the maximum allowable length is <max-length>.

Solution

Assign a string whose length is within the allowable range.

Examples

The following example raises the error because the value longerThan10 exceeds the allowable length:

@minLength(3)
@maxLength(10)
param storageAccountName string = 'longerThan10'

You can fix the error by assigning a string whose length is within the allowable range.

@minLength(3)
@maxLength(10)
param storageAccountName string = 'myStorage'

Next steps

For more information about Bicep error and warning codes, see Bicep core diagnostics.