Skip to main content

tags

Creates, updates, deletes, gets or lists a tags resource.

Overview

Nametags
TypeResource
Idazure.resources.tags

Fields

NameDatatypeDescription
idstringThe tag name ID.
countobjectTag count.
tagNamestringThe tag name.
valuesarrayThe list of tag values.

Methods

NameAccessible byRequired ParamsDescription
get_at_scopeSELECTscope
listSELECTsubscriptionIdThis 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_updateINSERTsubscriptionId, tagNameThis 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'.
create_or_update_at_scopeINSERTscope, data__propertiesThis operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.
deleteDELETEsubscriptionId, tagNameThis 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_at_scopeEXECscope
update_at_scopeEXECscopeThis operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.

SELECT examples

SELECT
id,
count,
tagName,
values
FROM azure.resources.tags
WHERE scope = '{{ scope }}';

INSERT example

Use the following StackQL query and manifest file to create a new tags resource.

/*+ create */
INSERT INTO azure.resources.tags (
subscriptionId,
tagName
)
SELECT
'{{ subscriptionId }}',
'{{ tagName }}'
;

DELETE example

Deletes the specified tags resource.

/*+ delete */
DELETE FROM azure.resources.tags
WHERE subscriptionId = '{{ subscriptionId }}'
AND tagName = '{{ tagName }}';