---
title: "PATCH /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}"
method: PATCH
path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}"
tags: ["scheduledQueryRules"]
---

# PATCH /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}

`PATCH /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}`

Update log search Rule.

## Path parameters

- `ruleName` string, required

## Parameters

- `../../../../../common-types/resource-management/v2/types.json#/components/parameters/SubscriptionIdParameter` — unresolved $ref
- `../../../../../common-types/resource-management/v2/types.json#/components/parameters/ResourceGroupNameParameter` — unresolved $ref
- `../../../../../common-types/resource-management/v2/types.json#/components/parameters/ApiVersionParameter` — unresolved $ref

## Request body

- LogSearchRuleResourcePatch — The log search rule resource for patch operations.
  - `tags` object — Resource tags
  - `properties` LogSearchRulePatch — Log Search Rule Definition for Patching
    - `enabled` 'true' | 'false' — The flag which indicates whether the Log Search rule is enabled. Value should be true or false

## Response `200`

Successful request to update an Log Search rule

- LogSearchRuleResource — An azure resource object
  - `id` string — Azure resource Id
  - `name` string — Azure resource name
  - `type` string — Azure resource type
  - `location` string, required — Resource location
  - `tags` object — Resource tags
  - `kind` string — Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.
  - `etag` string — The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.

## Other responses

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

## Changes

- **2021-12-16** (2018-04-16) `f1910f745a4c` — 1 warning
  - deleted the `path` request parameter `resourceGroupName`
- **2021-07-05** (2018-04-16) `abb3e959cad6` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/azure/apis/microsoft-insights-api/changes/subscriptions/:subscriptionId/resourcegroups/:resourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/:ruleName/patch.md)

---

[API](https://skmtc.dev/azure/apis/microsoft-insights-api.md) · [All operations](https://skmtc.dev/azure/apis/microsoft-insights-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/microsoft-insights-api/revisions/46c99d537bea/schema)
