Sdílet prostřednictvím


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
resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

resourceName
path True

string

The name of the Graph Query resource.

Regex pattern: ^[^<>&:\?]*$

subscriptionId
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

GraphQueryResource

The graph query definition updated.

Other Status Codes

GraphQueryError

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
createdByType

The type of identity that created the resource.

Error

The error object.

ErrorFieldContract

Error Field contract.

GraphQueryError

Error message body that will indicate why the operation failed.

GraphQueryResource

Graph Query entity definition.

GraphQueryUpdateParameters

The parameters that can be provided when updating workbook properties properties.

ResultKind

Enum indicating a type of graph query.

systemData

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

ErrorFieldContract[]

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

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

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

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

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

createdByType

The type of identity that last modified the resource.