Watcher - Update

Update the watcher identified by watcher name.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}?api-version=2015-10-31

URI Parameters

Name In Required Type Description
automationAccountName
path True
  • string

The name of the automation account.

resourceGroupName
path True
  • string

Name of an Azure Resource group.

Regex pattern: ^[-\w\._]+$

subscriptionId
path True
  • string

Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

watcherName
path True
  • string

The watcher name.

api-version
query True
  • string

Client Api Version.

Request Body

Name Type Description
name
  • string

Gets or sets the name of the resource.

properties.executionFrequencyInSeconds
  • integer

Gets or sets the frequency at which the watcher is invoked.

Responses

Name Type Description
200 OK

OK

Other Status Codes

Automation 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 watcher

Sample Request

PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher?api-version=2015-10-31
{
  "name": "MyTestWatcher",
  "properties": {
    "executionFrequencyInSeconds": 600
  }
}

Sample Response

{
  "id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher",
  "name": "MyTestWatcher",
  "type": null,
  "location": null,
  "tags": {},
  "etag": null,
  "properties": {
    "executionFrequencyInSeconds": 600,
    "scriptName": "MyTestWatcherRunbook",
    "scriptParameters": {},
    "description": "This is a test watcher.",
    "status": "New",
    "scriptRunOn": "MyTestHybridWorkerGroup",
    "creationTime": "2018-05-14T21:33:02.197+00:00",
    "lastModifiedBy": null,
    "lastModifiedTime": "2018-05-14T22:29:57.65+00:00"
  }
}

Definitions

ErrorResponse

Error response of an operation failure

Watcher

Definition of the watcher type.

WatcherUpdateParameters

ErrorResponse

Error response of an operation failure

Name Type Description
code
  • string

Error code

message
  • string

Error message indicating why the operation failed.

Watcher

Definition of the watcher type.

Name Type Description
etag
  • string

Gets or sets the etag of the resource.

id
  • string

Fully qualified resource Id for the resource

location
  • string

The Azure Region where the resource lives

name
  • string

The name of the resource

properties.creationTime
  • string

Gets or sets the creation time.

properties.description
  • string

Gets or sets the description.

properties.executionFrequencyInSeconds
  • integer

Gets or sets the frequency at which the watcher is invoked.

properties.lastModifiedBy
  • string

Details of the user who last modified the watcher.

properties.lastModifiedTime
  • string

Gets or sets the last modified time.

properties.scriptName
  • string

Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.

properties.scriptParameters
  • object

Gets or sets the parameters of the script.

properties.scriptRunOn
  • string

Gets or sets the name of the hybrid worker group the watcher will run on.

properties.status
  • string

Gets the current status of the watcher.

tags
  • object

Resource tags.

type
  • string

The type of the resource.

WatcherUpdateParameters

Name Type Description
name
  • string

Gets or sets the name of the resource.

properties.executionFrequencyInSeconds
  • integer

Gets or sets the frequency at which the watcher is invoked.