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

The following fields are returned by SELECT queries:

A graph query definition.

NameDatatypeDescription
idstringAzure resource Id
namestringAzure resource name. This is GUID value. The display name should be assigned within properties field.
etagstringThis will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict.
locationstringThe location of the resource
propertiesobjectMetadata describing a graph query for an Azure resource.
tagsobjectResource tags
typestringAzure resource type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, resourceNameGet a single graph query by its resourceName.
listselectsubscriptionId, resourceGroupNameGet all graph queries defined within a specified subscription and resource group.
list_by_subscriptionselectsubscriptionIdGet all graph queries defined within a specified subscription.
create_or_updateinsertsubscriptionId, resourceGroupName, resourceNameCreate a new graph query.
updateupdatesubscriptionId, resourceGroupName, resourceNameUpdates a graph query that has already been added.
deletedeletesubscriptionId, resourceGroupName, resourceNameDelete a graph query.

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.

NameDatatypeDescription
resourceGroupNamestringThe name of the resource group.
resourceNamestringThe name of the Graph Query resource.
subscriptionIdstringThe Azure subscription Id.

SELECT examples

Get a single graph query by its resourceName.

SELECT
id,
name,
etag,
location,
properties,
tags,
type
FROM azure.resource_graph.graph_queries
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND resourceName = '{{ resourceName }}' -- required
;

INSERT examples

Create a new graph query.

INSERT INTO azure.resource_graph.graph_queries (
data__location,
data__etag,
data__tags,
data__properties,
subscriptionId,
resourceGroupName,
resourceName
)
SELECT
'{{ location }}',
'{{ etag }}',
'{{ tags }}',
'{{ properties }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ resourceName }}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type
;

UPDATE examples

Updates a graph query that has already been added.

UPDATE azure.resource_graph.graph_queries
SET
data__tags = '{{ tags }}',
data__etag = '{{ etag }}',
data__properties = '{{ properties }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND resourceName = '{{ resourceName }}' --required
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;

DELETE examples

Delete a graph query.

DELETE FROM azure.resource_graph.graph_queries
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND resourceName = '{{ resourceName }}' --required
;