Azure Tags

Om Bhosle 100 Reputation points
2025-02-14T17:27:55.99+00:00

Hello All,

I have many subscriptions in my azure tenant. And I have assigned multiple tags to multiple resources and resource. So Know I want to download the list of the tags that are assigned and their respective data. It is a bit urgent. If anyone could help me how can I download all the tags that are created in my whole tenant with multiple subscriptions will be really helpful.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,329 questions
{count} votes

Accepted answer
  1. Naveena Patlolla 1,055 Reputation points Microsoft External Staff
    2025-02-25T05:21:34.3966667+00:00

    Hi Om Bhosle

    Thanks for your response and Take care of your health.

    I previously shared a script because to get tag names and values in different column for convenience. However, based on your output, we can achieve this directly through the Azure portal.

    In the Azure portal, navigate to All resources -> Click on Manage view -> Select Edit columns. Choose the following fields: Subscription, Location, and Tags, then click Save.

    User's image

    Next, select Export to CSV, and the desired output will be available in Excel as shown below.

    User's image

    Feel free to reach out if you have any further questions or need additional information—I’m happy to assist!

    Please provide your valuable comments User's image

    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Marcin Policht 38,630 Reputation points MVP
    2025-02-14T17:35:38.95+00:00

    Try the following

       $subscriptions = Get-AzSubscription
       $allTags = @()
    
       foreach ($sub in $subscriptions) {
           Set-AzContext -SubscriptionId $sub.Id
           $resources = Get-AzResource
    
           foreach ($resource in $resources) {
               $tags = $resource.Tags
               if ($tags) {
                   $allTags += [PSCustomObject]@{
                       SubscriptionId = $sub.Id
                       ResourceName   = $resource.Name
                       ResourceType   = $resource.ResourceType
                       Tags           = $tags
                   }
               }
           }
       }
    
       # Export to CSV
       $allTags | Export-Csv -Path "resources_tags.csv" -NoTypeInformation
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

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.