Graph Query - Update
Updates a graph query that has already been added.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}?api-version=2024-04-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
The name of the resource group. The name is case insensitive. |
resource
|
path | True |
string |
The name of the Graph Query resource. Regex pattern: |
subscription
|
path | True |
string uuid |
The ID of the target subscription. The value must be an UUID. |
api-version
|
query | True |
string |
The API version to use for this operation. |
Request Body
Name | Type | Description |
---|---|---|
etag |
string |
This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict. |
properties.description |
string |
The description of a graph query. |
properties.query |
string |
KQL query that will be graph. |
tags |
object |
Resource tags |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The graph query definition updated. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Update Graph Query
Sample request
PATCH https://management.azure.com/subscriptions/024e2271-06fa-46b6-9079-f1ed3c7b070e/resourceGroups/my-resource-group/providers/Microsoft.ResourceGraph/queries/MyDockerVMs?api-version=2024-04-01
{
"tags": null,
"etag": "b0809832-ca62-4133-8f13-0c46580f9db1",
"properties": {
"description": "Modified description",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'"
}
}
Sample response
{
"id": " /subscriptions/024e2271-06fa-46b6-9079-f1ed3c7b070e/resources/my-resource-group/providers/Microsoft.ResourceGraph/queries/MyDockerVMs",
"name": "MyDockerVMs",
"type": "Microsoft.ResourceGraph/queries",
"etag": "73811091-6188-4523-97b7-b5e7134e7fd9",
"tags": null,
"properties": {
"description": "Modified description",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
"resultKind": "basic",
"timeModified": "2019-03-14T13:51:13-07:00"
}
}
Definitions
Name | Description |
---|---|
created |
The type of identity that created the resource. |
Error |
The error object. |
Error |
Error Field contract. |
Graph |
Error message body that will indicate why the operation failed. |
Graph |
Graph Query entity definition. |
Graph |
The parameters that can be provided when updating workbook properties properties. |
Result |
Enum indicating a type of graph query. |
system |
Metadata pertaining to creation and last modification of the resource. |
createdByType
The type of identity that created the resource.
Name | Type | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
Error
The error object.
Name | Type | Description |
---|---|---|
code |
string |
Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. |
details |
The list of invalid fields send in request, in case of validation error. |
|
message |
string |
Human-readable representation of the error. |
ErrorFieldContract
Error Field contract.
Name | Type | Description |
---|---|---|
code |
string |
Property level error code. |
message |
string |
Human-readable representation of property-level error. |
target |
string |
Property name. |
GraphQueryError
Error message body that will indicate why the operation failed.
Name | Type | Description |
---|---|---|
error |
The error object. |
GraphQueryResource
Graph Query entity definition.
Name | Type | Description |
---|---|---|
etag |
string |
This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict. |
id |
string |
Azure resource Id |
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. |
properties.description |
string |
The description of a graph query. |
properties.query |
string |
KQL query that will be graph. |
properties.resultKind |
Enum indicating a type of graph query. |
|
properties.timeModified |
string |
Date and time in UTC of the last modification that was made to this graph query definition. |
systemData |
The system metadata relating to this resource. |
|
tags |
object |
Resource tags |
type |
string |
Azure resource type |
GraphQueryUpdateParameters
The parameters that can be provided when updating workbook properties properties.
Name | Type | Description |
---|---|---|
etag |
string |
This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict. |
properties.description |
string |
The description of a graph query. |
properties.query |
string |
KQL query that will be graph. |
tags |
object |
Resource tags |
ResultKind
Enum indicating a type of graph query.
Name | Type | Description |
---|---|---|
basic |
string |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
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 |
The type of identity that last modified the resource. |