tags
Creates, updates, deletes, gets or lists a tags
resource.
Overview
Name | tags |
Type | Resource |
Id | azure.resources.tags |
Fields
The following fields are returned by SELECT
queries:
- list
OK - Returns an array of tag names and values.
Name | Datatype | Description |
---|---|---|
id | string | The tag name ID. |
count | object | The total number of resources that use the resource tag. When a tag is initially created and has no associated resources, the value is 0. |
tagName | string | The tag name. |
values | array | The list of tag values. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | subscriptionId | This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. | |
create_or_update | insert | tagName , subscriptionId | This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. | |
delete | delete | tagName , subscriptionId | This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
tagName | string | The name of the tag. |
SELECT
examples
- list
This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
SELECT
id,
count,
tagName,
values
FROM azure.resources.tags
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
INSERT INTO azure.resources.tags (
tagName,
subscriptionId
)
SELECT
'{{ tagName }}',
'{{ subscriptionId }}'
RETURNING
id,
count,
tagName,
values
;
# Description fields are for documentation purposes
- name: tags
props:
- name: tagName
value: string
description: Required parameter for the tags resource.
- name: subscriptionId
value: string (uuid)
description: Required parameter for the tags resource.
DELETE
examples
- delete
This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.
DELETE FROM azure.resources.tags
WHERE tagName = '{{ tagName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;