Azure Resource Manager: Tags -List doesn't always return data when it should

Anonymous
2022-08-18T17:50:21.827+00:00

I'm retrieving the tag list for various subscriptions in Power Apps & Power Automate.

I have tested it as well with REST:
GET https://management.azure.com/subscriptions/{subscriptionId}/tagNames?api-version=2021-04-01

and almost always in all cases get back expected data, such as

{  
                "id": "/subscriptions/xyz/tagNames/costcenter",  
                "tagName": "costcenter",  
                "count": {  
                    "type": "Total",  
                    "value": 14  
                },  
                "values": [  
                    {  
                        "id": "/subscriptions/xyz/tagNames/costcenter/tagValues/48984",  
                        "tagValue": "48984",  
                        "count": {  
                            "type": "Total",  
                            "value": 3  
                        }  
                    },  

(and so on)

Which is great. However, at times, when calling the same subscriptions previously with returned data, I get back a successful call (Response code 200) but with no data

{
"value": []
}

Sometimes I have to retry for a minute or two. Today it lasted longer than that, 5+ minutes. And then data will be returned (eventually).

I confirmed the same blank data using calls in Power Apps, Automate & REST while the non-data was being served up. The common denominator seems to be the Azure Resource Manager.

Does anyone know why Azure Resource Manager has moments like this where one moment data is returned, then for a short time none?

Thanks.

Azure Migrate
Azure Migrate
A central hub of Azure cloud migration services and tools to discover, assess, and migrate workloads to the cloud.
760 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
836 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,111 Reputation points Microsoft Employee
    2022-08-29T19:24:53.66+00:00

    Hi @Tim Weiss ,

    In order to benefit the broader community, we determined that it comes to tag limits under Azure subscription and service limits, quotas, and constraints, the 80,000 limit applies to resource tags, not the tag itself. A unique tag is defined as the combination of resource ID, tag name, and tag value.

    The also identified some issue limitations with the API that they are actively working to improve upon. It is recommended to use Azure Resource Graph to pull distinct tags within the subscription. To get a list of distinct tagKey, tagValue pairs, you can use the following query below:

       resourcecontainers   
       | where isnotempty(tags)  
       | project id, tags  
       | mvexpand tags  
       | extend tagKey = tostring(bag_keys(tags)[0])  
       | extend tagValue = tostring(tags[tagKey])  
       | union (  
           resources  
           | where isnotempty(tags)  
           | project id, tags  
           | mvexpand tags  
           | extend tagKey = tostring(bag_keys(tags)[0])  
           | extend tagValue = tostring(tags[tagKey])  
       )  
       | where tagKey !startswith "hidden-"  
       | distinct tagKey, tagValue  
       | extend tagJson = pack(tagKey, tagValue)  
       | summarize make_list(tagJson)  
    
    0 comments No comments