question

HeikoNolte-8824 avatar image
0 Votes"
HeikoNolte-8824 asked tbgangav-MSFT answered

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

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
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Probably it will take some time to reflect. Do check back later.

0 Votes 0 ·

Hi @HeikoNolte-8824,

Did you get chance to review my earlier response? Let me know if you have any further queries regarding it.

0 Votes 0 ·

1 Answer

tbgangav-MSFT avatar image
0 Votes"
tbgangav-MSFT answered

Hi @HeikoNolte-8824,

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.