Skip to main content

graph_queries

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

Overview

Namegraph_queries
TypeResource
Idazure.resource_graph.graph_queries

Fields

NameDatatypeDescription
idtextAzure resource Id
nametextAzure resource name. This is GUID value. The display name should be assigned within properties field.
descriptiontextfield from the properties object
etagtextThis will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict.
locationtextThe location of the resource
querytextfield from the properties object
resourceGroupNametextfield from the properties object
resourceNametextfield from the properties object
result_kindtextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags
time_modifiedtextfield from the properties object
typetextAzure resource type

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, resourceName, subscriptionIdGet a single graph query by its resourceName.
listSELECTresourceGroupName, subscriptionIdGet all graph queries defined within a specified subscription and resource group.
list_by_subscriptionSELECTsubscriptionIdGet all graph queries defined within a specified subscription.
create_or_updateINSERTresourceGroupName, resourceName, subscriptionIdCreate a new graph query.
deleteDELETEresourceGroupName, resourceName, subscriptionIdDelete a graph query.
updateUPDATEresourceGroupName, resourceName, subscriptionIdUpdates a graph query that has already been added.

SELECT examples

Get all graph queries defined within a specified subscription.

SELECT
id,
name,
description,
etag,
location,
query,
resourceGroupName,
resourceName,
result_kind,
subscriptionId,
tags,
time_modified,
type
FROM azure.resource_graph.vw_graph_queries
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.resource_graph.graph_queries (
resourceGroupName,
resourceName,
subscriptionId,
location,
etag,
tags,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ resourceName }}',
'{{ subscriptionId }}',
'{{ location }}',
'{{ etag }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a graph_queries resource.

/*+ update */
UPDATE azure.resource_graph.graph_queries
SET
tags = '{{ tags }}',
etag = '{{ etag }}',
properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified graph_queries resource.

/*+ delete */
DELETE FROM azure.resource_graph.graph_queries
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';