Jagrati Modi
Jagrati Modi

Reputation: 2088

Azure Subscription Tags: How to delete an empty tag value?

Azure portal allows us to create a tag containing empty value for any resource/resource group (As seen in attached screenshot, 'test' tag is created with empty value).

enter image description here

If I want to delete the tag value i.e empty value, It is not possible to delete that value from Azure REST API, it shows this error message.

{
      "message":"No HTTP resource was found that matches the request URI 
                'https://management.azure.com/subscriptions/{subscription-id}/tagNames/test/tagValues/?api-version=2017-05-10'."
}

Suppose for example I create a tag in one resource having tag name 'department' and tag value 'finance':

{
    'department': 'finance'
}

and for other resource I create a tag with same tag name and empty value:

{
    'department': ''
}

Now I want to delete this empty tag value. In that case I can't use Tags - Delete method because I can't delete tag name here as this tag name is associated to other resource. So is it possible to delete the empty tag value?

Upvotes: 2

Views: 1580

Answers (1)

Thierry Prost
Thierry Prost

Reputation: 1025

You are looking at the wrong method. Try using Tags - Delete which only requires you to use tagName.

The Tags - Delete Value you referred to would indeed require both a tagValue and tagName.

So in your case, the REST request would be:

DELETE 
https://management.azure.com/subscriptions/{subscriptionId}/tagNames/test?api-version=2018-02-01

Upvotes: 1

Related Questions