-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tagging for resource groups #8166
Comments
Do you mean it will remove addition tags in the resource group? |
@markcowl Can you flesh out this issue a little further? |
No, there are properties that can exist in the resource group itself (as a resource) that are optional (and rare). For example, for 'ManagedBy' is a property that exists if a resource group is created by a service as a by-product of some other task (for example, some resources create a resource group in the region to place shared resources on behalf of the user. The issue is that, the serialization model for ResourceGroup does not contain any of these additional properties, so if a PUT is performed, it will remove any values from these properties, because the proeprty is not specified in the payload of the put. For example, a resource like: {
"properties": {
"name": "foo",
"id": "/subscriptions/xxxx-xxxx-xxxx-yyyy/ResourceGroups/foo",
"tags": ["foo", "bar"],
"managedBy": "Microsoft.Widgets"
}
} will appear in the PUT payload as: {
"properties": {
"name": "foo",
"id": "/subscriptions/xxxx-xxxx-xxxx-yyyy/ResourceGroups/foo",
"tags": ["foo", "bar"]
}
} So that the additional property 'ManagedBy' is removed. This can be resolved in a couple of ways: |
Description
Currently, tagging resource groups is only available through Set-AzResourceGroup, which will remove any additional properties applied to the resource group (e.g ManagedBy)
The text was updated successfully, but these errors were encountered: