How to add multiple values to one tag?

John Connor 316 Reputation points
2022-01-13T12:18:05.663+00:00

Hi,
I would like to add multiple values to one tag. E.g. a database might be used for several projects, so I would like to assign two project ids. I tried separating with semicolon or whitespace, added JSON as shown on the linked page but was not successful.

azure-resource-tags-in-json-format

So, how can I have a name "projectid" and provide values "1001 1002" so that it is also possible to search for 1001 and receive this resource as result? A workaround would be to have "projectid1" and "projectid2" but that is not really suitable for searching.

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
956 questions
{count} votes

Accepted answer
  1. Monalla-MSFT 13,046 Reputation points
    2022-01-13T14:01:15.323+00:00

    @John Connor - Thanks for reaching out.

    Currently a tag key can only have one string field as the value. Since it is only this one text field, a user cannot list multiple different strings in array, but you can append to the string if needed. So, for example: If it is "CostCode" as the Key, the value is "123". To add an additional value to this, you would need to have a value like "123,234".

    Product team is working on a new feature to allow an array of values to be created, but that will be later in 2022.

    Hope that helps.

    ---------------------------------------------------

    If the above response helped, please feel free to "Accept as Answer" and "upvote" the same so it can be beneficial to the community.

    4 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Amit Atugade 20 Reputation points
    2023-02-13T09:25:55.78+00:00

    do we have any update on adding multiple values in single tag?

    4 people found this answer helpful.

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.