Tag parameter not working with Get-AzureRMResourceGroup

Welcome Forums General PowerShell Q&A Tag parameter not working with Get-AzureRMResourceGroup

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
3 weeks, 4 days ago.

  • Author
    Posts
  • #172456

    Participant
    Topics: 1
    Replies: 2
    Points: 19
    Rank: Member

    Is anyone else experiencing an issue where the value in the key value pairs that are AzureRm resource tags are not filtered by key when running Get-AzureRMResourceGroup ?

    Example, the following returns all AzureRM resource groups that have any tag with the value of 'Value1':

    Get-AzureRmResourceGroup -Tag @{Label1= 'Value1'}

    Currently running AzureRM module version 6.13.1

  • #172558

    Participant
    Topics: 0
    Replies: 100
    Points: 363
    Helping Hand
    Rank: Contributor

    Hello Seabass,

    I just tested this with some Azure Resource Groups and it is working for me.

    Screenshot – Redirects to Onedrive and expires on 08-30-2019.

    Get-AzureRmResourceGroup -Tag @{Dept="IT"} | FL ResourceGroupName, Tags
    
    ResourceGroupName : cloud-shell-storage-westus
    Tags              : {Environment, Dept}
    
    ResourceGroupName : network-rg-westus
    Tags              : {Environment, Dept}
    
    ResourceGroupName : servers-rg-westus
    Tags              : {Environment, Dept}
    
    ResourceGroupName : stroage-rg-westus
    Tags              : {Environment, Dept}
    • #172835

      Participant
      Topics: 1
      Replies: 2
      Points: 19
      Rank: Member

      Hey Jason-

      Thanks for trying it out.  NOW try:

      Get-AzureRmResourceGroup -Tag @{Environment="IT"} 

      (assuming you don't have Environment tags without a value of "IT"

       

  • #173056

    Participant
    Topics: 0
    Replies: 100
    Points: 363
    Helping Hand
    Rank: Contributor

    Seabass,

    Looks like you are right, something weird is going on. I updated the test resource groups to confirm and it appears the filter is pulling all tags with the value IT in it. I even updated the department to Sales and can see all 4 resources pull even though the Department for one of the Resource Groups is sales. I would recommend you to open a case with Microsoft for additional support of the issue.

    Screenshot – Link expires on 08-30-2019

    • #173122

      Participant
      Topics: 1
      Replies: 2
      Points: 19
      Rank: Member

      Jason-

      Awesome, thanks for the confirmation!

You must be logged in to reply to this topic.