azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Set-AzureRMResource hangs indefinitely instead of failing attempting to apply a tag to a DSC Configuration resource type.

Open jmilczek opened this issue 8 years ago • 4 comments

Description

Unable to perform suggested steps to propagate Resource Group tags to Resources as mentioned in the following article Microsoft:

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags

Script/Steps for Reproduction

$groups = Get-AzureRmResourceGroup foreach ($g in $groups) { Find-AzureRmResource -ResourceGroupName $g.ResourceGroupName | ForEach-Object {Set-AzureRmResource -ResourceId $_.ResourceId -Tag $g.Tags -Force } }

Module Version

AzureRM 6.2.1

Environment Data

Name Value


PSVersion 5.0.10514.6
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 10.0.10514.6
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3

Debug Output

I do not feel comfortable sharing this output to the public, but it seems to be in an endless loop attempting to apply a tag when it gets to a resource of the DSC Configuration type.

jmilczek avatar Jun 12 '18 19:06 jmilczek

@jmilczek I'm unable to reproduce this issue in the latest version of AzureRM when updating a variety of resources. Are you only seeing this issue for a specific type of resource (in this case, DSC configuration)?

cormacpayne avatar Jul 12 '18 19:07 cormacpayne

@jmilczek Ping

maddieclayton avatar Jul 16 '18 23:07 maddieclayton

Yes, the DSC Configuration resource type.

jmilczek avatar Jul 17 '18 00:07 jmilczek

I am unable to repro this with the DSC configuration resource type:

PS C:\Users\maclayto> get-azurermresource -ResourceGroupName maddie1 -Name automation-test/lampserver

Name              : automation-test/lampserver
ResourceGroupName : maddie1
ResourceType      : Microsoft.Automation/automationAccounts/configurations
Location          : westcentralus
ResourceId        : /subscriptions/<redacted>/resourceGroups/maddie1/providers/Microsoft.Auto
                    mation/automationAccounts/automation-test/configurations/lampserver

PS C:\Users\maclayto> set-azurermresource -ResourceId /subscriptions/<redacted>/resourceGroups
/maddie1/providers/Microsoft.Automation/automationAccounts/automation-test/configurations/lampserver -Tag @{"a"="b"}

Confirm
Are you sure you want to update the following resource:
/subscriptions/<redacted>/resourceGroups/maddie1/providers/Microsoft.Automation/automationAccounts/automation-test/configurations/lampserver
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y


Name              : lampserver
ResourceId        : /subscriptions/<redacted>/resourceGroups/maddie1/providers/Microsoft.Auto
                    mation/automationAccounts/automation-test/configurations/lampserver
ResourceName      : automation-test/lampserver
ResourceType      : Microsoft.Automation/automationAccounts/configurations
ResourceGroupName : maddie1
Location          : West Central US
SubscriptionId    : <redacted>
Tags              : {a}
Properties        : @{provisioningState=Succeeded; jobCount=0; parameters=; description=; source=; state=Published;
                    creationTime=2018-07-24T23:11:36.3166667+00:00;
                    lastModifiedTime=2018-07-24T23:13:16.2733333+00:00; logVerbose=False; rawTags=;
                    nodeConfigurationCount=0}
ETag              : <redacted>

Closing this issue as cannot repro. @jmilczek If you have a more specific set of instructions for reproing this issue in the latest version of AzureRM please let me know and I will reopen.

maddieclayton avatar Jul 24 '18 23:07 maddieclayton