Skip to content

[Bug Report]: Policy Assignment 'NonComplianceMessages' property is string instead of array #1643

@ahmadabdalla

Description

@ahmadabdalla

Describe the bug

Discussed in #1625

Originally posted by dibcar June 30, 2022
How can I use the policyAssignments module for an policy initiative and configure a non-compliance message per policy? The nonComplanceMessages parameter is defined as a string instead of an array as defined in API version 2021-06-01.

Arm template :
"nonComplianceMessages": [
{
"message": "Default message"
},
{
"message": "Message for just this policy definition by reference ID",
"policyDefinitionReferenceId": "10420126870854049575"
}
]

Policy Assignment module exposes the 'NonComplianceMessages' property as a string instead of an array and converts it into an array in the logic. The other thing is that the parameter name should be plural aligning to the reference doc.

This should align with the ARM Reference documentation like the following:

    nonComplianceMessages: [
      {
        message: 'string'
        policyDefinitionReferenceId: 'string'
      }
    ]

To reproduce

Try passing in the nonComplianceMessages as an array and it will fail.

Code snippet

param nonComplianceMessage string = ''

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

[cat] modulescategory: modulesbugSomething isn't working

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions