Updating tags of resources not reflected in Azure portal resource overview but in resource JSON description

Heiko Nolte 1 Reputation point
2021-03-19T09:22:35.167+00:00

Hello, I have updated a tag on all resources of a certain resource group using the powershell script below. When I inspect the JSON definitions of the resources the tag has been successfully updated. Searching the tagged resources in Azure portal all resources list works as well. But when I open the resource overview in Azure portal, the old tag value is still visible. Refreshing the resource didn't help, signing in and out either. Ist this a known issue of Azure portal?

Powershell script:
Get-AzureRmSubscription –SubscriptionName "MySub" | Select-AzureRmSubscription

$allobjects =Get-AzureRmResource 
$ResourceGroupName = 'PoC_Prototype'

$myTags = New-Object System.Collections.Hashtable;
$myTags.Add("ApplicationName","MyApp")

#Set Tags on Resource Group
  $resgroup = Get-AzureRmResourceGroup -Name $ResourceGroupName
  Set-AzureRmResource -Tag $myTags -ResourceId $resgroup.ResourceId -force

#Tag all elements of the Resource Group
  ForEach ($armobject In $allobjects) {
   Write-Host $armobject.Name
    if($armobject.ResourceGroupName -eq $ResourceGroupName){
      Set-AzureRmResource -Tag $myTags -ResourceId $armobject.ResourceId -force   
  }
}
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,798 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,376 Reputation points
    2021-03-19T14:07:28.857+00:00

    Hi @Heiko Nolte ,

    I have tried to reproduce the issue with the same good script that you have shared but I was successfully able to see the tag being updated in the resources of a resource group. In my case, I even didn't had to wait for long for the change to reflect; it was instant.

    If the issue still persists for you, please confirm if you have received any error while executing the script. If No, then as a basic troubleshooting, write-host the variables at regular steps and see if the variables hold the required values or not. Or try out for another test resource group with one or two test resources to see if the prior issue is with one particular resource group or not.

    0 comments No comments