Empty default values in azure policy initiative paramters

Igor Levin 1 Reputation point
2022-01-12T09:44:49.493+00:00

Hello,

I've created an azure policy initiative definition that uses a policy definition to tag resources with default values if some tags do not exist and other conditions.
In the azure policy initiative definition, I created initiative parameters with empty default values. When I tried to assign the policy I got an error that I need to give values for those parameters.
I returned to the policy initiative definition and gave an empty string ("") as the default value because in the original policy definition that I'm using inside the initiative definition I had an empty string ("") as the default value and when I created an assignment it assigned it assigned the tag without any value.
The problem is that when I use the empty string ("") as the default value for the policy initiative parameters in tags with the value of "" and not an empty value like in the original policy definition.
After that when I tried to remove the default values from the initiative so I don't have any string there It gave me an error that I can't have an empty default value.

My question is how can the tags the policy initiative tags have an empty value (like in the normal policy definition) and not an "" as the value?

I'm adding screenshots of the original policy definition tagValue parameter with the default value that works and a screenshot of the policy initiative parameter window with the default value I used an need to change to empty.

164313-tag-value.png164206-initiative-paramter-default-value.png

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
1,014 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 21,546 Reputation points Moderator
    2022-01-17T06:55:33.423+00:00

    Hi @Igor Levin

    Welcome to Microsoft Q&A! Apologies for the delayed response.

    Based on my understanding, you are trying to remove the defaultValue for Initiative Parameter after its creation and mapping with Policy definition. This cannot be done after the creation, based on my tests. While creating the Initiative parameters, if you have used a default value (for example - ""), you can only modify the default value and not remove it. The error received is like what you are receiving:

    165621-image.png

    To overcome it, please delete the initiative and create the initiative again. While creating the Initiative parameter, ensure that appropriate default value is added or NOT added.

    165499-image.png

    Please let me know if I missed something.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.