Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This rule discourages the use of the any type in Bicep files.
Linter rule code
Use the following value in the Bicep configuration file to customize rule settings:
no-explicit-any
Solution
Using any disables type checking and removes the benefits of Bicep's strong typing system. This can lead to runtime deployment errors that could have been caught earlier by the compiler. Instead of any, specify a more precise type such as string, int, bool, array, object, and so on. This helps ensure your templates are predictable and maintainable. For more information about Bicep types, see Data types in Bicep.
The following example fails this rule:
param inputValue any
You can fix it by declaring a specific type:
param inputValue string
Next steps
For more information about the linter, see Use Bicep linter.