You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/management/tag-resources.md
+44-31Lines changed: 44 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ Properties :
76
76
Environment Production
77
77
```
78
78
79
-
If you provide a new value for a tag and use the merge operation, the old value is replaced. The following example changes the Status tag from Normal to Green.
79
+
Each tag name can have only one value. If you provide a new value for a tag, the old value is replaced even if you use the merge operation. The following example changes the Status tag from Normal to Green.
To apply tags from a subscription or resource group to the resources, see [Azure Policies - tags](tag-policies.md).
157
+
Tags applied to the resource group or subscription aren't inherited by the resources. To apply tags from a subscription or resource group to the resources, see [Azure Policies - tags](tag-policies.md).
177
158
178
159
### List tags
179
160
180
-
To get the tags for a resource, resource group, or subscription, use the [Get-AzTag](/powershell/module/az.resources/get-aztag) command and pass in the entity.
161
+
To get the tags for a resource, resource group, or subscription, use the [Get-AzTag](/powershell/module/az.resources/get-aztag) command and pass in the resource ID for the entity.
181
162
182
163
To see the tags for a resource, use:
183
164
@@ -279,7 +260,7 @@ Currently, Azure CLI doesn't support applying tags to subscriptions.
279
260
280
261
### Inherit tags
281
262
282
-
To apply tags from a subscription or resource group to the resources, see [Azure Policies - tags](tag-policies.md).
263
+
Tags applied to the resource group or subscription aren't inherited by the resources. To apply tags from a subscription or resource group to the resources, see [Azure Policies - tags](tag-policies.md).
283
264
284
265
### List tags
285
266
@@ -338,17 +319,21 @@ IFS=$origIFS
338
319
339
320
## ARM templates
340
321
341
-
You can tag resources, resource groups, and subscriptions during deployment with an ARM template.
322
+
You can tag resources, resource groups, and subscriptions during deployment with an ARM template.
342
323
343
-
### Apply literal values
324
+
### Apply values
344
325
345
-
The following example deploys a storage account with two tags(`Dept` and `Environment`) that are set to literal values:
326
+
The following example deploys a storage account with three tags. Two of the tags (`Dept` and `Environment`) are set to literal values. One tag (`LastDeployed`) is set to a parameter that defaults to the current date.
@@ -362,7 +347,8 @@ The following example deploys a storage account with two tags (`Dept` and `Envir
362
347
"location": "[parameters('location')]",
363
348
"tags": {
364
349
"Dept": "Finance",
365
-
"Environment": "Production"
350
+
"Environment": "Production",
351
+
"LastDeployed": "[parameters('utcShort')]"
366
352
},
367
353
"sku": {
368
354
"name": "Standard_LRS"
@@ -374,11 +360,9 @@ The following example deploys a storage account with two tags (`Dept` and `Envir
374
360
}
375
361
```
376
362
377
-
To set a tag to a datetime value, use the [utcNow function](../templates/template-functions-string.md#utcnow).
378
-
379
363
### Apply an object
380
364
381
-
You can define an object parameter that stores several tags, and apply that object to the tag element. This approach provides more flexibility than the previous example because the object can have any properties. Each property in the object becomes a separate tag for the resource. The following example has a parameter named `tagValues` that is applied to the tag element.
365
+
You can define an object parameter that stores several tags, and apply that object to the tag element. This approach provides more flexibility than the previous example because the object can have different properties. Each property in the object becomes a separate tag for the resource. The following example has a parameter named `tagValues` that is applied to the tag element.
az deployment sub create --name tagresourcegroup --location westus2 --template-uri https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/tags.json
537
521
```
538
522
523
+
The following template adds the tags from an object to either a resource group or subscription.
@@ -560,7 +574,6 @@ The following limitations apply to tags:
560
574
* Each resource or resource group can have a maximum of 50 tag name/value pairs. If you need to apply more tags than the maximum allowed number, use a JSON string for the tag value. The JSON string can contain many values that are applied to a single tag name. A resource group can contain many resources that each have 50 tag name/value pairs.
561
575
* The tag name is limited to 512 characters, and the tag value is limited to 256 characters. For storage accounts, the tag name is limited to 128 characters, and the tag value is limited to 256 characters.
562
576
* Generalized VMs don't support tags.
563
-
* Tags applied to the resource group are not inherited by the resources in that resource group.
564
577
* Tags can't be applied to classic resources such as Cloud Services.
565
578
* Tag names can't contain these characters: `<`, `>`, `%`, `&`, `\`, `?`, `/`
Copy file name to clipboardExpand all lines: includes/resource-manager-tag-resources.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,19 +5,21 @@
5
5
author: tfitzmac
6
6
ms.service: azure-resource-manager
7
7
ms.topic: include
8
-
ms.date: 01/03/2020
8
+
ms.date: 03/19/2020
9
9
ms.author: tomfitz
10
10
ms.custom: include file
11
11
---
12
12
13
13
1. To view the tags for a resource or a resource group, look for existing tags in the overview. If you have not previously applied tags, the list is empty.
14
-
15
-

14
+
15
+

16
+
16
17
1. To add a tag, select **Click here to add tags**.
17
18
18
-
1. Provide a name and value. Select **+** to add the tag.
0 commit comments