1. Packages
  2. Azure Native v2
  3. API Docs
  4. resourcegraph
  5. GraphQuery
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.resourcegraph.GraphQuery

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

Graph Query entity definition. Azure REST API version: 2020-04-01-preview. Prior API version in Azure Native 1.x: 2018-09-01-preview.

Other available API versions: 2018-09-01-preview, 2019-04-01, 2021-03-01, 2022-10-01, 2024-04-01.

Example Usage

Create Graph Query

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var graphQuery = new AzureNative.ResourceGraph.GraphQuery("graphQuery", new()
    {
        Description = "Docker VMs in PROD",
        Query = "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
        ResourceGroupName = "my-resource-group",
        ResourceName = "MyDockerVMs",
        Tags = null,
    });

});
Copy
package main

import (
	resourcegraph "github.com/pulumi/pulumi-azure-native-sdk/resourcegraph/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := resourcegraph.NewGraphQuery(ctx, "graphQuery", &resourcegraph.GraphQueryArgs{
			Description:       pulumi.String("Docker VMs in PROD"),
			Query:             pulumi.String("where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'"),
			ResourceGroupName: pulumi.String("my-resource-group"),
			ResourceName:      pulumi.String("MyDockerVMs"),
			Tags:              pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.resourcegraph.GraphQuery;
import com.pulumi.azurenative.resourcegraph.GraphQueryArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var graphQuery = new GraphQuery("graphQuery", GraphQueryArgs.builder()
            .description("Docker VMs in PROD")
            .query("where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'")
            .resourceGroupName("my-resource-group")
            .resourceName("MyDockerVMs")
            .tags()
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const graphQuery = new azure_native.resourcegraph.GraphQuery("graphQuery", {
    description: "Docker VMs in PROD",
    query: "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
    resourceGroupName: "my-resource-group",
    resourceName: "MyDockerVMs",
    tags: {},
});
Copy
import pulumi
import pulumi_azure_native as azure_native

graph_query = azure_native.resourcegraph.GraphQuery("graphQuery",
    description="Docker VMs in PROD",
    query="where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
    resource_group_name="my-resource-group",
    resource_name_="MyDockerVMs",
    tags={})
Copy
resources:
  graphQuery:
    type: azure-native:resourcegraph:GraphQuery
    properties:
      description: Docker VMs in PROD
      query: where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'
      resourceGroupName: my-resource-group
      resourceName: MyDockerVMs
      tags: {}
Copy

Create GraphQuery Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new GraphQuery(name: string, args: GraphQueryArgs, opts?: CustomResourceOptions);
@overload
def GraphQuery(resource_name: str,
               args: GraphQueryArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def GraphQuery(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               query: Optional[str] = None,
               resource_group_name: Optional[str] = None,
               description: Optional[str] = None,
               resource_name_: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
func NewGraphQuery(ctx *Context, name string, args GraphQueryArgs, opts ...ResourceOption) (*GraphQuery, error)
public GraphQuery(string name, GraphQueryArgs args, CustomResourceOptions? opts = null)
public GraphQuery(String name, GraphQueryArgs args)
public GraphQuery(String name, GraphQueryArgs args, CustomResourceOptions options)
type: azure-native:resourcegraph:GraphQuery
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GraphQueryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GraphQueryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GraphQueryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GraphQueryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GraphQueryArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var graphQueryResource = new AzureNative.Resourcegraph.GraphQuery("graphQueryResource", new()
{
    Query = "string",
    ResourceGroupName = "string",
    Description = "string",
    ResourceName = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := resourcegraph.NewGraphQuery(ctx, "graphQueryResource", &resourcegraph.GraphQueryArgs{
	Query:             "string",
	ResourceGroupName: "string",
	Description:       "string",
	ResourceName:      "string",
	Tags: map[string]interface{}{
		"string": "string",
	},
})
Copy
var graphQueryResource = new GraphQuery("graphQueryResource", GraphQueryArgs.builder()
    .query("string")
    .resourceGroupName("string")
    .description("string")
    .resourceName("string")
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
graph_query_resource = azure_native.resourcegraph.GraphQuery("graphQueryResource",
    query=string,
    resource_group_name=string,
    description=string,
    resource_name_=string,
    tags={
        string: string,
    })
Copy
const graphQueryResource = new azure_native.resourcegraph.GraphQuery("graphQueryResource", {
    query: "string",
    resourceGroupName: "string",
    description: "string",
    resourceName: "string",
    tags: {
        string: "string",
    },
});
Copy
type: azure-native:resourcegraph:GraphQuery
properties:
    description: string
    query: string
    resourceGroupName: string
    resourceName: string
    tags:
        string: string
Copy

GraphQuery Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GraphQuery resource accepts the following input properties:

Query This property is required. string
KQL query that will be graph.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
Description string
The description of a graph query.
ResourceName Changes to this property will trigger replacement. string
The name of the Graph Query resource.
Tags Dictionary<string, string>
Resource tags
Query This property is required. string
KQL query that will be graph.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
Description string
The description of a graph query.
ResourceName Changes to this property will trigger replacement. string
The name of the Graph Query resource.
Tags map[string]string
Resource tags
query This property is required. String
KQL query that will be graph.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
description String
The description of a graph query.
resourceName Changes to this property will trigger replacement. String
The name of the Graph Query resource.
tags Map<String,String>
Resource tags
query This property is required. string
KQL query that will be graph.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
description string
The description of a graph query.
resourceName Changes to this property will trigger replacement. string
The name of the Graph Query resource.
tags {[key: string]: string}
Resource tags
query This property is required. str
KQL query that will be graph.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
description str
The description of a graph query.
resource_name Changes to this property will trigger replacement. str
The name of the Graph Query resource.
tags Mapping[str, str]
Resource tags
query This property is required. String
KQL query that will be graph.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
description String
The description of a graph query.
resourceName Changes to this property will trigger replacement. String
The name of the Graph Query resource.
tags Map<String>
Resource tags

Outputs

All input properties are implicitly available as output properties. Additionally, the GraphQuery resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Location string
The location of the resource
Name string
Azure resource name. This is GUID value. The display name should be assigned within properties field.
ResultKind string
Enum indicating a type of graph query.
SystemData Pulumi.AzureNative.ResourceGraph.Outputs.SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
TimeModified string
Date and time in UTC of the last modification that was made to this graph query definition.
Type string
Azure resource type
Etag string
This will be used to handle Optimistic Concurrency.
Id string
The provider-assigned unique ID for this managed resource.
Location string
The location of the resource
Name string
Azure resource name. This is GUID value. The display name should be assigned within properties field.
ResultKind string
Enum indicating a type of graph query.
SystemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
TimeModified string
Date and time in UTC of the last modification that was made to this graph query definition.
Type string
Azure resource type
Etag string
This will be used to handle Optimistic Concurrency.
id String
The provider-assigned unique ID for this managed resource.
location String
The location of the resource
name String
Azure resource name. This is GUID value. The display name should be assigned within properties field.
resultKind String
Enum indicating a type of graph query.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
timeModified String
Date and time in UTC of the last modification that was made to this graph query definition.
type String
Azure resource type
etag String
This will be used to handle Optimistic Concurrency.
id string
The provider-assigned unique ID for this managed resource.
location string
The location of the resource
name string
Azure resource name. This is GUID value. The display name should be assigned within properties field.
resultKind string
Enum indicating a type of graph query.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
timeModified string
Date and time in UTC of the last modification that was made to this graph query definition.
type string
Azure resource type
etag string
This will be used to handle Optimistic Concurrency.
id str
The provider-assigned unique ID for this managed resource.
location str
The location of the resource
name str
Azure resource name. This is GUID value. The display name should be assigned within properties field.
result_kind str
Enum indicating a type of graph query.
system_data SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
time_modified str
Date and time in UTC of the last modification that was made to this graph query definition.
type str
Azure resource type
etag str
This will be used to handle Optimistic Concurrency.
id String
The provider-assigned unique ID for this managed resource.
location String
The location of the resource
name String
Azure resource name. This is GUID value. The display name should be assigned within properties field.
resultKind String
Enum indicating a type of graph query.
systemData Property Map
Metadata pertaining to creation and last modification of the resource.
timeModified String
Date and time in UTC of the last modification that was made to this graph query definition.
type String
Azure resource type
etag String
This will be used to handle Optimistic Concurrency.

Supporting Types

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource last modification (UTC)
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:resourcegraph:GraphQuery MyDockerVMs /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi