tags
Creates, updates, deletes, gets or lists a tags
resource.
Overview
Name | tags |
Type | Resource |
Id | azure.resources.tags |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The tag name ID. |
count | object | Tag count. |
tagName | string | The tag name. |
values | array | The list of tag values. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_at_scope | SELECT | scope | |
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 | subscriptionId, tagName | 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'. |
create_or_update_at_scope | INSERT | scope, data__properties | This 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. |
delete | DELETE | subscriptionId, tagName | 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_at_scope | EXEC | scope | |
update_at_scope | EXEC | scope | This 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.resources.tags (
subscriptionId,
tagName
)
SELECT
'{{ subscriptionId }}',
'{{ tagName }}'
;
- name: your_resource_model_name
props: []
DELETE
example
Deletes the specified tags
resource.
/*+ delete */
DELETE FROM azure.resources.tags
WHERE subscriptionId = '{{ subscriptionId }}'
AND tagName = '{{ tagName }}';