Parameter value should match strong type#
Operational Excellence · All resources · Rule · 2021_12 · Awareness
Set the parameter value to a value that matches the specified strong type.
Description#
Template string parameters can optionally specify a strong type. Bicep can also emit resource type metadata for string parameters. When parameter files are expanded, if the parameter value does not match the type this rule fails. Support is provided by PSRule for Azure for the following types:
- Resource type - Specify a resource type.
For example
Microsoft.OperationalInsights/workspaces. If a resource type is specified the parameter value must be a resource id of that type. This can be set by usingmetadata.strongTypeor Bicepmetadata.resourceType. Formetadata.resourceType, any API version after@is ignored. - Location - Specify
locationas the strong type. Iflocationis specified, the parameter value must be a valid Azure location.
Recommendation#
Consider updating the parameter value to a value that matches the specified strong type.