Share via


az graph shared-query

Note

This reference is part of the resource-graph extension for the Azure CLI (version 2.22.0 or higher). The extension will automatically install the first time you run an az graph shared-query command. Learn more about extensions.

This command group is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage shared query of Azure resource graph.

Commands

Name Description Type Status
az graph shared-query create

Create a shared query.

Extension Experimental
az graph shared-query delete

Delete a shared query.

Extension Experimental
az graph shared-query list

List all shared query in a resource group.

Extension Experimental
az graph shared-query show

Show the properties of a shared query.

Extension Experimental

az graph shared-query create

Experimental

Command group 'graph shared-query' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a shared query.

az graph shared-query create --description
                             --graph-query
                             --name
                             --resource-group
                             [--tags]

Examples

Create a shared query requesting a subset of resource fields.

az graph shared-query create -g MyResourceGroup -n MySharedQuery -q "project id, name, type, location, tags" -d "requesting a subset of resource fields." --tags key=value

Required Parameters

--description -d

Description of the graph shared query.

--graph-query --q -q

Resource Graph query to execute.

--name -n

Name of the graph shared query.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az graph shared-query delete

Experimental

Command group 'graph shared-query' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a shared query.

az graph shared-query delete --name
                             --resource-group

Required Parameters

--name -n

Name of the graph shared query.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az graph shared-query list

Experimental

Command group 'graph shared-query' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all shared query in a resource group.

az graph shared-query list --resource-group

Examples

List all shared query in a resource group.

az graph shared-query list -g MyResourceGroup

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az graph shared-query show

Experimental

Command group 'graph shared-query' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show the properties of a shared query.

az graph shared-query show --name
                           --resource-group

Required Parameters

--name -n

Name of the graph shared query.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.