Muokkaa

Jaa


Bicep diagnostic code - BCP332

This diagnostic occurs when a string or array exceeding the allowable length is assigned.

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>.

Level

Warning / Error

Solution

Assign a string whose length is within the allowable range.

Examples

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

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

You can fix the diagnostic 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 diagnostics, see Bicep core diagnostics.