Not possible to update policyDefinitionReferenceId with New- or Update-AzPolicySetDefinition #25112
Labels
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
customer-reported
Description
I want to update my policyDefinitionReferenceIds in my policy initiative definition definitions.json.
I am using a policy initiative definition file:
networkdef.json
and a parameter file:
networkparam.json
These 2 files are how I created the policy initiative definition. However, the policyDefinitionReferenceIds is being overwritten by the system and automatically generated. You can see that result in the first file (definitions.json)
To create the definition, I use this command:
The above code, should have created the policyDefinitionReferenceIds for me. However, it is ignored as I said.
When I then try to update them again, I get the same result regardless if I use
Update-AzPolicySetDefinition
orNew-AzPolicySetDefinition
.New-AzPolicySetDefinition -Name 'Enforce-Guardrails-Network' -PolicyDefinition .\definitions.json -Parameter .\networkparam.json
or
Update-AzPolicySetDefinition -Name 'Enforce-Guardrails-Network' -PolicyDefinition .\definitions.json -Parameter .\networkparam.json
Output:
Expected Output
When running the $DebugPreference it is clear that the property policyDefinitionReferenceId is not part of the properties available
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: