Skip to content

BYL3xxx: Validation

Reported after a file has run and its fields have been resolved: checks of names, properties, parameters, operators, effects and Azure's limits, and, once every file has compiled, of each initiative's members against the policies they include.

Code Severity Meaning
BYL3001 Error Invalid policy or initiative name
BYL3002 Error Missing or long DisplayName
BYL3003 Error Description too long
BYL3004 Error Unsupported Mode
BYL3005 Error Invalid Version
BYL3006 Error Metadata key set elsewhere
BYL3007 Error Invalid metadata value
BYL3010 Error -Be with a list
BYL3011 Error -BeLike with more than one *
BYL3012 Error * in -ContainText
BYL3013 Warning Match pattern that looks like a regular expression
BYL3014 Error Text operator needs a string
BYL3016 Error Comparison needs a number, string or date
BYL3017 Error -BeIn with a single value
BYL3020 Error Parameter used but not declared
BYL3021 Error Default not in the allowed values
BYL3022 Error Two parameters with the same JSON name
BYL3023 Error Array parameter where a single value is needed
BYL3024 Error -BeIn with a parameter that isn't an Array
BYL3025 Error Text operator with a parameter that isn't a String
BYL3026 Error Comparison with a parameter Azure can't order
BYL3027 Error Default of the wrong type
BYL3028 Error Allowed values of the wrong type
BYL3029 Warning Parameter never used
BYL3030 Error Unsupported effect
BYL3031 Error Effect parameter isn't a String
BYL3032 Error Effect parameter needs allowed values
BYL3033 Error Effect parameter allows an unsupported effect
BYL3034 Error Tag name parameter isn't a String
BYL3040 Warning Tags or location checked with Mode All
BYL3041 Warning Policy has no Require block
BYL3042 Error Policy with no conditions
BYL3050 Error Too many field counts on one array
BYL3051 Error Rule too large
BYL3052 Error Too many value counts
BYL3053 Error Value count iterates too many times
BYL3060 Error Role not found
BYL3061 Error Role given twice
BYL3062 Error Modify effect parameter allows an effect Modify can't use
BYL3063 Error Remove on something other than a tag
BYL3064 Error Field Modify can't change
BYL3065 Error identity.type on an unsupported type
BYL3066 Error Modify on nested array elements
BYL3067 Error Field changed twice
BYL3068 Error Unsupported function in -Condition
BYL3069 Warning Tag modified with Mode All
BYL3070 Warning Modified field not checked
BYL3071 Warning Alias modified without -ConflictEffect Audit
BYL3072 Error Effect parameter allows an effect the policy can't use
BYL3073 Error -CascadeBehavior needs Mode Indexed
BYL3074 Warning DenyAction on a type it never applies to
BYL3075 Warning Modify on array elements is in preview
BYL3080 Error Append on nested array elements
BYL3081 Error Field added twice
BYL3082 Warning Tag added with Append
BYL3083 Warning Appended field not checked
BYL3090 Warning IfNotExists on the resource itself needs its name
BYL3091 Warning AuditIfNotExists on the resource itself
BYL3092 Warning Option ignored for a child resource
BYL3093 Error Value passed to a template parameter that doesn't exist
BYL3094 Error Required template parameter not passed
BYL3095 Error -EvaluationDelay parameter with values Azure doesn't accept
BYL3100 Error Count compared with something other than a whole number
BYL3101 Error Count -Value with a parameter that isn't an Array
BYL3110 Error Reference ID used twice
BYL3111 Error Invalid PolicyDefinition -Id
BYL3112 Error Definition group declared twice
BYL3113 Error Member in an undeclared group
BYL3114 Warning Definition group with no members
BYL3115 Error Initiative too large
BYL3120 Error Member policy not in the build
BYL3121 Error Value passed to a parameter the policy doesn't have
BYL3122 Error Required policy parameter not passed
BYL3123 Error Passed value doesn't fit the parameter
BYL3124 Error Initiative parameter of the wrong type
BYL3125 Error Initiative parameter allows values the policy doesn't
BYL3126 Error -Version doesn't match the policy
BYL3127 Warning Member name differs from the policy's in case
BYL3128 Warning Initiative parameter allows any value
BYL3129 Warning -Version on a member from the build
BYL3130 Error Invalid Param -Length

BYL3001

Invalid policy or initiative name (error)

The name becomes the definition's name in Azure and its file name, so it must be 1 to 64 characters, with none of < > * % & : \ ? . + / " |, no control characters, no leading or trailing space, and not a name Windows reserves for files, such as CON.

To fix it: Rename the Policy or Initiative. Renaming a deployed definition creates a new one, so choose a name you can keep.

See ADR-0010.

BYL3002

Missing or long DisplayName (error)

Every definition needs a DisplayName, the name shown in the portal, and Azure allows at most 128 characters.

To fix it: Add DisplayName to Properties, or shorten it. Put the detail in Description.

See ADR-0016.

BYL3003

Description too long (error)

Azure allows at most 512 characters in a definition's description.

To fix it: Shorten the Description. Longer guidance can go in Metadata or in your own documentation.

See ADR-0016.

BYL3004

Unsupported Mode (error)

Language version 1.0 supports the All and Indexed modes. The resource provider modes, such as Microsoft.Kubernetes.Data, have different rules and effects, which Bylaw doesn't cover yet.

To fix it: Use Mode = 'All' or 'Indexed'.

See ADR-0016.

BYL3005

Invalid Version (error)

A definition's version is major.minor.patch, optionally with -preview or -deprecated, so tools and initiative members can compare versions.

To fix it: Use a version such as '1.0.0' or '2.1.0-preview'.

See ADR-0016.

BYL3006

Metadata key set elsewhere (error)

Metadata can't set a key that Bylaw writes from Properties, such as version or category, or deployedBy, which EPAC sets when it deploys.

To fix it: Set it with its own Properties key, e.g. Properties @{ Version = '1.0.0' }, or leave deployedBy to EPAC.

See ADR-0011.

BYL3007

Invalid metadata value (error)

Each metadata value must have a JSON form, so no scriptblocks or other PowerShell objects, and Azure allows at most 1024 characters per value.

To fix it: Use strings, numbers, booleans, arrays and hashtables, and keep each value under 1024 characters.

BYL3010

-Be with a list (error)

-Be compares with one value. A list would be emitted as an equals with an array, which is never true for a single value.

To fix it: Use -BeIn for a list of values.

For example:

Field minimumTlsVersion | Must -BeIn 'TLS1_2', 'TLS1_3'

See ADR-0015.

BYL3011

**-BeLike with more than one *** (error)

Azure's like operator allows at most one * wildcard in a pattern.

To fix it: Use one *, or test the parts with several conditions, or use -Match for a fixed-length pattern.

See ADR-0015.

BYL3012

*** in -ContainText** (error)

Azure's contains operator doesn't allow wildcards: a * would be looked for literally.

To fix it: Remove the *, or use -BeLike for a wildcard match.

See ADR-0015.

BYL3013

Match pattern that looks like a regular expression (warning)

Azure's match patterns aren't regular expressions: # is a digit, ? a letter, . any character, and everything else is literal. A pattern with ^, $, \d, [, ( or + is probably meant as a regex and won't match what you expect.

To fix it: Rewrite the pattern with #, ? and ., or use -BeLike for a wildcard match.

For example:

Field name | Must -Match 'st????##'

See ADR-0015.

BYL3014

Text operator needs a string (error)

-BeLike, -Match, -MatchCase, -ContainText and -ContainKey compare text, so their value must be a string.

To fix it: Quote the value, or use a String parameter.

See ADR-0015.

BYL3016

Comparison needs a number, string or date (error)

-BeGreaterThan, -BeGreaterOrEqual, -BeLessThan and -BeLessOrEqual compare numbers, strings or dates. Azure can't order other values, such as booleans or arrays.

To fix it: Compare with a number, a string or a date string.

See ADR-0015.

BYL3017

-BeIn with a single value (error)

ResourceGroupTag is one value, so it can't be the list -BeIn needs.

To fix it: Use -Be to compare with the tag's value.

For example:

Tag CostCenter | Must -Be (ResourceGroupTag CostCenter)

See ADR-0020.

BYL3020

Parameter used but not declared (error)

A Param refers to a parameter that the Policy or Initiative doesn't declare, so the emitted [parameters('name')] would fail when the policy is deployed. The message says where it is used: in a rule, an effect, a tag name, a count, a deployment or an initiative member.

To fix it: Declare the parameter with Parameter, or correct the name in Param. Names are matched as written in Parameter.

For example:

Parameter AllowedLocations -Type Array -Metadata @{ strongType = 'location' }
Field location | Must -BeIn (Param AllowedLocations)

See ADR-0021.

BYL3021

Default not in the allowed values (error)

A parameter's default must be one of its allowed values, or Azure rejects the definition.

To fix it: Change the default, or add it to -AllowedValues.

See ADR-0021.

BYL3022

Two parameters with the same JSON name (error)

Parameter names are emitted with a lower-case first letter, so Effect and effect, for example, would both become effect.

To fix it: Rename one of them, or give one an explicit -JsonName.

See ADR-0018.

BYL3023

Array parameter where a single value is needed (error)

The operator compares with one value, but the parameter is an Array.

To fix it: Use -BeIn to test against the list, or declare the parameter as a single value.

See ADR-0021.

BYL3024

-BeIn with a parameter that isn't an Array (error)

-BeIn needs a list, but the parameter holds a single value.

To fix it: Declare the parameter with -Type Array, or use -Be.

See ADR-0021.

BYL3025

Text operator with a parameter that isn't a String (error)

-BeLike, -Match, -MatchCase, -ContainText and -ContainKey need text, but the parameter is of another type.

To fix it: Declare the parameter as a String.

See ADR-0021.

BYL3026

Comparison with a parameter Azure can't order (error)

The comparison operators need a number, string or date, but the parameter is of another type, such as Boolean or Array.

To fix it: Declare the parameter as an Integer, Float, String or DateTime.

See ADR-0021.

BYL3027

Default of the wrong type (error)

A parameter's default must be of its type, or Azure rejects the definition: for example a list for an Array, or $true or $false for a Boolean.

To fix it: Correct the default, or the -Type.

See ADR-0021.

BYL3028

Allowed values of the wrong type (error)

Every allowed value must be of the parameter's type. The message lists the ones that aren't.

To fix it: Correct the allowed values, or the -Type.

See ADR-0021.

BYL3029

Parameter never used (warning)

A parameter is declared but no rule, effect or value uses it, or in an initiative, no member is passed it. An assignment could set it to no effect, which is usually a mistake.

To fix it: Use the parameter, or remove it.

See ADR-0021.

BYL3030

Unsupported effect (error)

Effect takes Audit, Deny or Disabled; the other effects have keywords of their own. The message lists the supported effects, and says which keyword to use for an effect with details.

To fix it: Use one of the effects the message lists, or the effect's own keyword, such as Modify or DeployIfNotExists.

See ADR-0017.

BYL3031

Effect parameter isn't a String (error)

An effect parameter holds the name of an effect, so it must be a String.

To fix it: Declare it with -Type String, or leave -Type out and give it -AllowedValues.

See ADR-0017.

BYL3032

Effect parameter needs allowed values (error)

Without allowed values, an assignment could set any effect, including one the policy can't use. Azure's built-in policies always list them.

To fix it: Add -AllowedValues with the effects the policy supports.

For example:

Parameter Effect -AllowedValues Audit, Deny, Disabled -Default Audit
Effect (Param Effect)

See ADR-0017.

BYL3033

Effect parameter allows an unsupported effect (error)

One of the effect parameter's allowed values isn't an effect Bylaw supports for this kind of policy.

To fix it: Remove that value from -AllowedValues.

See ADR-0017.

BYL3034

Tag name parameter isn't a String (error)

A parameter used as a tag name, as in Tag (Param TagName), must hold one name, so it must be a String.

To fix it: Declare the parameter with -Type String.

See ADR-0020.

BYL3040

Tags or location checked with Mode All (warning)

With Mode All, the policy also evaluates resource types that don't support tags or location, which are then reported as non-compliant. Azure recommends Indexed for policies on tags and location.

To fix it: Add Mode = 'Indexed' to Properties, unless the policy is meant for resource groups or subscriptions.

See ADR-0016.

BYL3041

Policy has no Require block (warning)

Without a Require, every resource that matches the resource type and When is non-compliant. That is sometimes intended, for example to deny a resource type, but usually a Require is missing.

To fix it: Add a Require describing a compliant resource, or, to deny the type outright, keep it as it is.

BYL3042

Policy with no conditions (error)

Resource * with no When and no Require would match every resource in scope, which is almost never intended and, with Deny, would block every deployment.

To fix it: Add a When or Require, or give the policy a resource type.

BYL3050

Too many field counts on one array (error)

Azure allows at most 5 field count expressions on the same array in a rule. Each Each and Count on that array is one.

To fix it: Combine the Each blocks for the array into one, with several statements inside.

See ADR-0032.

BYL3051

Rule too large (error)

Azure allows at most 4096 condition expressions in a rule's if. This usually comes from a loop that generates many requirements.

To fix it: Split the policy into several, for example one per group of settings, and put them in an initiative.

BYL3052

Too many value counts (error)

Azure allows at most 10 value counts (Count -Value) in a rule.

To fix it: Combine counts over the same list, or split the policy.

See ADR-0032.

BYL3053

Value count iterates too many times (error)

Azure allows a value count at most 100 iterations, with nested counts multiplied. A literal list that long, or nested lists that multiply to it, exceeds that.

To fix it: Count a shorter list, or pass the list as a parameter, which Azure evaluates at assignment time.

See ADR-0032.

BYL3060

Role not found (error)

A -Role name isn't a built-in role in the role map, so Bylaw can't turn it into a role definition ID. The message suggests the closest name.

To fix it: Correct the role name, give a custom role by its GUID or full role definition ID, or refresh the role map with Update-BylawRoleCache.

See ADR-0022.

BYL3061

Role given twice (error)

Two -Role values resolve to the same role, for example its name and its GUID.

To fix it: Give each role once.

See ADR-0022.

BYL3062

Modify effect parameter allows an effect Modify can't use (error)

The effect parameter of a Modify policy can allow Modify, Audit and Disabled. A Modify policy changes the request, so it never denies it.

To fix it: Remove the other values from -AllowedValues.

For example:

Parameter Effect -AllowedValues Modify, Audit, Disabled -Default Modify

See ADR-0024.

BYL3063

Remove on something other than a tag (error)

Azure's Modify can only remove tags.

To fix it: Use AddOrReplace to change the field instead.

See ADR-0024.

BYL3064

Field Modify can't change (error)

Modify can change tags, identity.type and aliases that Azure marks as modifiable. The field is none of those, according to the alias snapshot.

To fix it: Change a modifiable alias instead, use Append to add the value on create, or use DeployIfNotExists.

See ADR-0024.

BYL3065

identity.type on an unsupported type (error)

Azure's Modify can only change identity.type on virtual machines and virtual machine scale sets, and skips the operation on other types, so the policy would do nothing.

To fix it: Scope the policy to Microsoft.Compute/virtualMachines or virtualMachineScaleSets, or remove the operation.

See ADR-0024.

BYL3066

Modify on nested array elements (error)

Learn documents Modify on one array level, x[] or x[].property, not on arrays inside array elements.

To fix it: Modify the outer array's elements, or the whole array alias with the complete value.

See ADR-0024.

BYL3067

Field changed twice (error)

Two Modify operations change the same field, and Azure would apply them in an order you can't rely on.

To fix it: Use one operation per field.

See ADR-0024.

BYL3068

Unsupported function in -Condition (error)

A Modify operation's condition can't use the field(), resourceGroup() or subscription() functions, which Azure doesn't support there.

To fix it: Use other policy functions, such as parameters() or requestContext(), or move the condition into When.

See ADR-0024.

BYL3069

Tag modified with Mode All (warning)

Azure recommends Mode = 'Indexed' for Modify policies on tags, so resource types that don't support tags aren't evaluated. The exception is a policy on resource groups.

To fix it: Add Mode = 'Indexed' to Properties, unless the policy targets resource groups.

See ADR-0024.

BYL3070

Modified field not checked (warning)

Modify changes the field, but no Require checks it. Azure only remediates non-compliant resources, so the change would never be triggered by that field, and a remediated resource could still be non-compliant.

To fix it: Add a Require that checks the field has the value Modify sets.

For example:

Modify -Role 'Tag Contributor' {
    Tag Environment | AddOrReplace 'Production'
}
Resource * {
    Require 'Environment is Production' {
        Tag Environment | Must -Be 'Production'
    }
}

See ADR-0024.

BYL3071

Alias modified without -ConflictEffect Audit (warning)

An alias can be modifiable in some API versions and not others. Azure recommends -ConflictEffect Audit when Modify changes aliases, so requests using other API versions are audited rather than denied.

To fix it: Add -ConflictEffect Audit to Modify.

See ADR-0024.

BYL3072

Effect parameter allows an effect the policy can't use (error)

The effect parameter of an Append, DenyAction, Manual, AuditIfNotExists or DeployIfNotExists policy allows an effect that kind of policy can't use. The message lists the ones it can.

To fix it: Remove the other values from -AllowedValues.

See ADR-0017.

BYL3073

-CascadeBehavior needs Mode Indexed (error)

Azure only supports DenyAction's cascade behavior in policies with Mode = 'Indexed'.

To fix it: Add Mode = 'Indexed' to Properties, or remove -CascadeBehavior.

See ADR-0017.

BYL3074

DenyAction on a type it never applies to (warning)

Azure's denyAction never applies to some resource types: policy assignments, deny assignments, blueprint assignments, deployment stacks, subscriptions and locks. A DenyAction policy on one of them has no effect.

To fix it: Scope the policy to the resources you want to protect.

See ADR-0017.

BYL3075

Modify on array elements is in preview (warning)

Learn documents Modify's add and addOrReplace on array elements, x[] and x[].property, as in preview. Add on x[] adds a member; AddOrReplace on x[] removes every existing member first, then adds this one; on x[*].property, either sets the property in every member.

To fix it: Check the behaviour on a test resource. To keep the existing members, use Add rather than AddOrReplace on x[*].

See ADR-0024.

BYL3080

Append on nested array elements (error)

Learn documents Append on one array level: x[] adds an element to the array, and x[].property adds the property to every element. It doesn't document arrays inside array elements, such as x[].y[].

To fix it: Add to the outer array's elements, with each element as a hashtable, or add the whole array.

For example:

Append {
    Field 'networkAcls.ipRules[*]' | Add @{ value = '203.0.113.0/24'; action = 'Allow' }
}

See ADR-0029.

BYL3081

Field added twice (error)

Two Add operations add to the same field.

To fix it: Use one Add per field. To add several array elements, add an array.

See ADR-0029.

BYL3082

Tag added with Append (warning)

Azure recommends Modify for tags: it can also remediate existing resources, and Append can't.

To fix it: Use Modify -Role 'Tag Contributor' { Tag ... | Add ... } instead.

See ADR-0029.

BYL3083

Appended field not checked (warning)

Append adds the field, but no Require checks it, so existing resources are reported as non-compliant whatever their value.

To fix it: Add a Require that checks the field has the value Append adds.

See ADR-0029.

BYL3090

IfNotExists on the resource itself needs its name (warning)

When -Type is the Resource type, Learn requires -Name to be the evaluated resource's own name. Azure accepts other names, or none, but then the existence check may find a different resource of the same type.

To fix it: Use -Name (Arm "[field('name')]"), or (Arm "[field('fullName')]") for a child resource.

See ADR-0030.

BYL3091

AuditIfNotExists on the resource itself (warning)

AuditIfNotExists checks the resource being evaluated, not a related one. Learn suggests the Audit effect for this, which is simpler and evaluated straight away.

To fix it: Use Effect Audit, with the existence condition as a Require block.

See ADR-0030.

BYL3092

Option ignored for a child resource (warning)

The related type is a child of the Resource type, and Azure only looks for child resources under the evaluated resource, so -ResourceGroupName or -ExistenceScope has no effect.

To fix it: Remove the option.

See ADR-0030.

BYL3093

Value passed to a template parameter that doesn't exist (error)

Deployment -Parameters passes a name the template doesn't declare, so the deployment would fail when a remediation task runs. The message lists the template's parameters.

To fix it: Correct the name, or add the parameter to the template.

See ADR-0031.

BYL3094

Required template parameter not passed (error)

The template has a parameter with no defaultValue, and Deployment doesn't pass it, so the deployment would fail.

To fix it: Pass it in -Parameters, or give it a defaultValue in the template.

See ADR-0031.

BYL3095

-EvaluationDelay parameter with values Azure doesn't accept (error)

A parameter passed to -EvaluationDelay is emitted as [parameters('...')], so its value must be an evaluation delay: a String whose default and allowed values are AfterProvisioning, AfterProvisioningSuccess, AfterProvisioningFailure, or an ISO 8601 duration from 0 to 360 minutes.

To fix it: Declare the parameter as a String, and fix its -Default and -AllowedValues.

For example:

Parameter EvaluationDelay -Default PT10M
DeployIfNotExists 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups' -Role 'Network Contributor' -EvaluationDelay (Param EvaluationDelay) { ... }

See ADR-0030.

BYL3100

Count compared with something other than a whole number (error)

A count is a whole number, so it is compared with whole numbers: a literal, an Integer parameter, an Array parameter for -BeIn, or Arm.

To fix it: Compare with a number, or declare the parameter as an Integer.

For example:

Count securityRules[*] | Must -BeLessOrEqual (Param MaxRules)

See ADR-0032.

BYL3101

Count -Value with a parameter that isn't an Array (error)

A value count goes through the members of a list, so its parameter must be an Array.

To fix it: Declare the parameter with -Type Array.

See ADR-0032.

BYL3110

Reference ID used twice (error)

Each member of an initiative needs its own reference ID, ignoring case. A policy can be a member more than once, with different reference IDs.

To fix it: Give each member its own -ReferenceId.

For example:

PolicyDefinition 'tags-inherit-from-resource-group' -ReferenceId 'inherit-cost-center' -Parameters @{ tagName = 'CostCenter' }
PolicyDefinition 'tags-inherit-from-resource-group' -ReferenceId 'inherit-owner' -Parameters @{ tagName = 'Owner' }

See ADR-0033.

BYL3111

Invalid PolicyDefinition -Id (error)

-Id must be a policy definition ID: /providers/Microsoft.Authorization/policyDefinitions/, optionally after a management group or subscription, or a built-in policy's GUID on its own. An initiative can't include another initiative.

To fix it: Correct the ID. To use an initiative's policies, include them one by one.

See ADR-0033.

BYL3112

Definition group declared twice (error)

Each DefinitionGroup name can be declared once in an initiative.

To fix it: Remove the second declaration, or rename it.

See ADR-0033.

BYL3113

Member in an undeclared group (error)

A PolicyDefinition -Group names a group that no DefinitionGroup declares, which Azure rejects.

To fix it: Declare the group with DefinitionGroup, or correct the name.

See ADR-0033.

BYL3114

Definition group with no members (warning)

One or more DefinitionGroups aren't used by any PolicyDefinition -Group. Azure allows this, and regulatory compliance initiatives rely on it: they declare a group for each control of a standard, including controls no policy checks, so those still show in the compliance view. It can also be a mistake, such as a misspelt -Group on the member that belongs to it. One warning lists them all, at the first.

To fix it: If the groups are controls no policy checks, leave them. Otherwise add each group to the members that belong to it, or remove it.

See ADR-0033.

BYL3115

Initiative too large (error)

Azure allows an initiative at most 1000 members and 400 parameters.

To fix it: Split the initiative into several.

See ADR-0033.

BYL3120

Member policy not in the build (error)

A PolicyDefinition by name must be a policy in this build, so its parameters can be checked and EPAC can resolve it. The message suggests the closest name.

To fix it: Correct the name, add the policy to the build, or include a policy defined elsewhere with PolicyDefinition -Id.

See ADR-0034.

BYL3121

Value passed to a parameter the policy doesn't have (error)

A member's -Parameters passes a name that isn't one of the policy's parameters, as the policy is emitted. The message lists them.

To fix it: Use the parameter's JSON name, which starts with a lower-case letter, e.g. effect, or remove the value.

See ADR-0034.

BYL3122

Required policy parameter not passed (error)

The policy has a parameter with no default, and the member doesn't pass it, so an assignment of the initiative would fail.

To fix it: Pass it in -Parameters, as a value or an initiative parameter, or give it a default in the policy.

See ADR-0034.

BYL3123

Passed value doesn't fit the parameter (error)

A literal passed to a member is of the wrong type for the policy's parameter, or isn't one of its allowed values.

To fix it: Pass a value of the parameter's type, from its allowed values.

See ADR-0034.

BYL3124

Initiative parameter of the wrong type (error)

An initiative parameter passed to a member is of a different type from the policy's parameter.

To fix it: Declare the initiative parameter with the same type as the policy's.

See ADR-0034.

BYL3125

Initiative parameter allows values the policy doesn't (error)

An initiative parameter passed to a member has a default, or allowed values, that the policy's parameter doesn't allow, so an assignment could pass a value the policy rejects.

To fix it: Limit the initiative parameter's -AllowedValues and default to values the policy allows.

See ADR-0034.

BYL3126

-Version doesn't match the policy (error)

A member's -Version asks for a version the policy in this build isn't, or the policy has no Version, so the assignment would use a version this build doesn't produce.

To fix it: Make -Version match the policy's Version, e.g. '1..' for 1.2.0, or remove it.

See ADR-0034.

BYL3127

Member name differs from the policy's in case (warning)

Azure ignores case in names, but tools such as EPAC may match them exactly, and the member is emitted as written.

To fix it: Write the name exactly as the Policy declares it.

See ADR-0034.

BYL3128

Initiative parameter allows any value (warning)

An initiative parameter with no allowed values is passed to a policy parameter that has some, so an assignment could pass a value the policy rejects.

To fix it: Give the initiative parameter -AllowedValues within the policy's.

See ADR-0034.

BYL3129

-Version on a member from the build (warning)

Azure matches definitionVersion against a definition's top-level version property, which Bylaw emits only from PolicyVersion, in plain JSON: Version goes to metadata.version. Azure gives a definition without one version 1.0.0, so a pin such as 1.2.* may not select the version you expect.

To fix it: Remove -Version from members in this build, unless the pin is 1.., or give the policy a PolicyVersion and build with -Format PlainJson.

See ADR-0034.

BYL3130

Invalid Param -Length (error)

Param -Length is Azure's length() of a parameter, which takes an Array, String or Object, and it is a whole number, so it is tested with -Be or a comparison.

To fix it: Use -Length on an Array, String or Object parameter, and compare it with -Be, -BeIn or a comparison operator.

For example:

Count -Value (Param NamePatterns) -Name pattern -Where { Field name | Must -BeLike (Current pattern) } | Must -Be (Param NamePatterns -Length)

See ADR-0020.