---
title: "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}"
method: PUT
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}"
tags: ["GraphQuery"]
---

# PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}

`PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}`

Create a new graph query.

## Path parameters

- `subscriptionId` string, required
- `resourceGroupName` string, required
- `resourceName` string, required

## Query parameters

- `api-version` string, required

## Request body

- GraphQueryResource — An azure resource object
  - `id` string — Azure resource Id
  - `name` string — Azure resource name. This is GUID value. The display name should be assigned within properties field.
  - `location` string — The location of the resource
  - `type` string — Azure resource type
  - `etag` string — This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict.
  - `tags` object — Resource tags

## Response `200`

The newly created graph query.

- GraphQueryResource — An azure resource object
  - `id` string — Azure resource Id
  - `name` string — Azure resource name. This is GUID value. The display name should be assigned within properties field.
  - `location` string — The location of the resource
  - `type` string — Azure resource type
  - `etag` string — This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict.
  - `tags` object — Resource tags

## Other responses

- `default` — Error response describing why the operation failed.

## Changes

- **2020-05-07** (2018-09-01-preview) `81cc99e10786` — 1 info
  - api tag `GraphQuery` added
- **2019-11-26** (2018-09-01-preview) `9eee4bcdf9f2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/azure/apis/azure-resource-graph-query/changes/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.ResourceGraph/queries/:resourceName/put.md)

---

[API](https://skmtc.dev/azure/apis/azure-resource-graph-query.md) · [All operations](https://skmtc.dev/azure/apis/azure-resource-graph-query/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/azure-resource-graph-query/revisions/38a2dcd8c948/schema)
