1. Packages
  2. Azure Native
  3. API Docs
  4. automation
  5. Watcher
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.0.1 published on Monday, Apr 7, 2025 by Pulumi

azure-native.automation.Watcher

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.0.1 published on Monday, Apr 7, 2025 by Pulumi

Definition of the watcher type.

Uses Azure REST API version 2023-05-15-preview. In version 2.x of the Azure Native provider, it used API version 2020-01-13-preview.

Other available API versions: 2015-10-31, 2019-06-01, 2020-01-13-preview, 2024-10-23. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native automation [ApiVersion]. See the version guide for details.

Example Usage

Create or update watcher

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var watcher = new AzureNative.Automation.Watcher("watcher", new()
    {
        AutomationAccountName = "MyTestAutomationAccount",
        Description = "This is a test watcher.",
        ExecutionFrequencyInSeconds = 60,
        ResourceGroupName = "rg",
        ScriptName = "MyTestWatcherRunbook",
        ScriptRunOn = "MyTestHybridWorkerGroup",
        Tags = null,
        WatcherName = "MyTestWatcher",
    });

});
Copy
package main

import (
	automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := automation.NewWatcher(ctx, "watcher", &automation.WatcherArgs{
			AutomationAccountName:       pulumi.String("MyTestAutomationAccount"),
			Description:                 pulumi.String("This is a test watcher."),
			ExecutionFrequencyInSeconds: pulumi.Float64(60),
			ResourceGroupName:           pulumi.String("rg"),
			ScriptName:                  pulumi.String("MyTestWatcherRunbook"),
			ScriptRunOn:                 pulumi.String("MyTestHybridWorkerGroup"),
			Tags:                        pulumi.StringMap{},
			WatcherName:                 pulumi.String("MyTestWatcher"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.automation.Watcher;
import com.pulumi.azurenative.automation.WatcherArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var watcher = new Watcher("watcher", WatcherArgs.builder()
            .automationAccountName("MyTestAutomationAccount")
            .description("This is a test watcher.")
            .executionFrequencyInSeconds(60)
            .resourceGroupName("rg")
            .scriptName("MyTestWatcherRunbook")
            .scriptRunOn("MyTestHybridWorkerGroup")
            .tags()
            .watcherName("MyTestWatcher")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const watcher = new azure_native.automation.Watcher("watcher", {
    automationAccountName: "MyTestAutomationAccount",
    description: "This is a test watcher.",
    executionFrequencyInSeconds: 60,
    resourceGroupName: "rg",
    scriptName: "MyTestWatcherRunbook",
    scriptRunOn: "MyTestHybridWorkerGroup",
    tags: {},
    watcherName: "MyTestWatcher",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

watcher = azure_native.automation.Watcher("watcher",
    automation_account_name="MyTestAutomationAccount",
    description="This is a test watcher.",
    execution_frequency_in_seconds=60,
    resource_group_name="rg",
    script_name="MyTestWatcherRunbook",
    script_run_on="MyTestHybridWorkerGroup",
    tags={},
    watcher_name="MyTestWatcher")
Copy
resources:
  watcher:
    type: azure-native:automation:Watcher
    properties:
      automationAccountName: MyTestAutomationAccount
      description: This is a test watcher.
      executionFrequencyInSeconds: 60
      resourceGroupName: rg
      scriptName: MyTestWatcherRunbook
      scriptRunOn: MyTestHybridWorkerGroup
      tags: {}
      watcherName: MyTestWatcher
Copy

Create Watcher Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Watcher(name: string, args: WatcherArgs, opts?: CustomResourceOptions);
@overload
def Watcher(resource_name: str,
            args: WatcherArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Watcher(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            automation_account_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            description: Optional[str] = None,
            execution_frequency_in_seconds: Optional[float] = None,
            location: Optional[str] = None,
            script_name: Optional[str] = None,
            script_parameters: Optional[Mapping[str, str]] = None,
            script_run_on: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            watcher_name: Optional[str] = None)
func NewWatcher(ctx *Context, name string, args WatcherArgs, opts ...ResourceOption) (*Watcher, error)
public Watcher(string name, WatcherArgs args, CustomResourceOptions? opts = null)
public Watcher(String name, WatcherArgs args)
public Watcher(String name, WatcherArgs args, CustomResourceOptions options)
type: azure-native:automation:Watcher
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WatcherArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WatcherArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WatcherArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WatcherArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WatcherArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var watcherResource = new AzureNative.Automation.Watcher("watcherResource", new()
{
    AutomationAccountName = "string",
    ResourceGroupName = "string",
    Description = "string",
    ExecutionFrequencyInSeconds = 0,
    Location = "string",
    ScriptName = "string",
    ScriptParameters = 
    {
        { "string", "string" },
    },
    ScriptRunOn = "string",
    Tags = 
    {
        { "string", "string" },
    },
    WatcherName = "string",
});
Copy
example, err := automation.NewWatcher(ctx, "watcherResource", &automation.WatcherArgs{
	AutomationAccountName:       pulumi.String("string"),
	ResourceGroupName:           pulumi.String("string"),
	Description:                 pulumi.String("string"),
	ExecutionFrequencyInSeconds: pulumi.Float64(0),
	Location:                    pulumi.String("string"),
	ScriptName:                  pulumi.String("string"),
	ScriptParameters: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	ScriptRunOn: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	WatcherName: pulumi.String("string"),
})
Copy
var watcherResource = new Watcher("watcherResource", WatcherArgs.builder()
    .automationAccountName("string")
    .resourceGroupName("string")
    .description("string")
    .executionFrequencyInSeconds(0)
    .location("string")
    .scriptName("string")
    .scriptParameters(Map.of("string", "string"))
    .scriptRunOn("string")
    .tags(Map.of("string", "string"))
    .watcherName("string")
    .build());
Copy
watcher_resource = azure_native.automation.Watcher("watcherResource",
    automation_account_name="string",
    resource_group_name="string",
    description="string",
    execution_frequency_in_seconds=0,
    location="string",
    script_name="string",
    script_parameters={
        "string": "string",
    },
    script_run_on="string",
    tags={
        "string": "string",
    },
    watcher_name="string")
Copy
const watcherResource = new azure_native.automation.Watcher("watcherResource", {
    automationAccountName: "string",
    resourceGroupName: "string",
    description: "string",
    executionFrequencyInSeconds: 0,
    location: "string",
    scriptName: "string",
    scriptParameters: {
        string: "string",
    },
    scriptRunOn: "string",
    tags: {
        string: "string",
    },
    watcherName: "string",
});
Copy
type: azure-native:automation:Watcher
properties:
    automationAccountName: string
    description: string
    executionFrequencyInSeconds: 0
    location: string
    resourceGroupName: string
    scriptName: string
    scriptParameters:
        string: string
    scriptRunOn: string
    tags:
        string: string
    watcherName: string
Copy

Watcher Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Watcher resource accepts the following input properties:

AutomationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of an Azure Resource group.
Description string
Gets or sets the description.
ExecutionFrequencyInSeconds double
Gets or sets the frequency at which the watcher is invoked.
Location Changes to this property will trigger replacement. string
The geo-location where the resource lives
ScriptName string
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
ScriptParameters Dictionary<string, string>
Gets or sets the parameters of the script.
ScriptRunOn string
Gets or sets the name of the hybrid worker group the watcher will run on.
Tags Dictionary<string, string>
Resource tags.
WatcherName Changes to this property will trigger replacement. string
The watcher name.
AutomationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of an Azure Resource group.
Description string
Gets or sets the description.
ExecutionFrequencyInSeconds float64
Gets or sets the frequency at which the watcher is invoked.
Location Changes to this property will trigger replacement. string
The geo-location where the resource lives
ScriptName string
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
ScriptParameters map[string]string
Gets or sets the parameters of the script.
ScriptRunOn string
Gets or sets the name of the hybrid worker group the watcher will run on.
Tags map[string]string
Resource tags.
WatcherName Changes to this property will trigger replacement. string
The watcher name.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the automation account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of an Azure Resource group.
description String
Gets or sets the description.
executionFrequencyInSeconds Double
Gets or sets the frequency at which the watcher is invoked.
location Changes to this property will trigger replacement. String
The geo-location where the resource lives
scriptName String
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
scriptParameters Map<String,String>
Gets or sets the parameters of the script.
scriptRunOn String
Gets or sets the name of the hybrid worker group the watcher will run on.
tags Map<String,String>
Resource tags.
watcherName Changes to this property will trigger replacement. String
The watcher name.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of an Azure Resource group.
description string
Gets or sets the description.
executionFrequencyInSeconds number
Gets or sets the frequency at which the watcher is invoked.
location Changes to this property will trigger replacement. string
The geo-location where the resource lives
scriptName string
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
scriptParameters {[key: string]: string}
Gets or sets the parameters of the script.
scriptRunOn string
Gets or sets the name of the hybrid worker group the watcher will run on.
tags {[key: string]: string}
Resource tags.
watcherName Changes to this property will trigger replacement. string
The watcher name.
automation_account_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the automation account.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
Name of an Azure Resource group.
description str
Gets or sets the description.
execution_frequency_in_seconds float
Gets or sets the frequency at which the watcher is invoked.
location Changes to this property will trigger replacement. str
The geo-location where the resource lives
script_name str
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
script_parameters Mapping[str, str]
Gets or sets the parameters of the script.
script_run_on str
Gets or sets the name of the hybrid worker group the watcher will run on.
tags Mapping[str, str]
Resource tags.
watcher_name Changes to this property will trigger replacement. str
The watcher name.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the automation account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of an Azure Resource group.
description String
Gets or sets the description.
executionFrequencyInSeconds Number
Gets or sets the frequency at which the watcher is invoked.
location Changes to this property will trigger replacement. String
The geo-location where the resource lives
scriptName String
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
scriptParameters Map<String>
Gets or sets the parameters of the script.
scriptRunOn String
Gets or sets the name of the hybrid worker group the watcher will run on.
tags Map<String>
Resource tags.
watcherName Changes to this property will trigger replacement. String
The watcher name.

Outputs

All input properties are implicitly available as output properties. Additionally, the Watcher resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
CreationTime string
Gets or sets the creation time.
Id string
The provider-assigned unique ID for this managed resource.
LastModifiedBy string
Details of the user who last modified the watcher.
LastModifiedTime string
Gets or sets the last modified time.
Name string
The name of the resource
Status string
Gets the current status of the watcher.
SystemData Pulumi.AzureNative.Automation.Outputs.SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Etag string
Gets or sets the etag of the resource.
AzureApiVersion string
The Azure API version of the resource.
CreationTime string
Gets or sets the creation time.
Id string
The provider-assigned unique ID for this managed resource.
LastModifiedBy string
Details of the user who last modified the watcher.
LastModifiedTime string
Gets or sets the last modified time.
Name string
The name of the resource
Status string
Gets the current status of the watcher.
SystemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Etag string
Gets or sets the etag of the resource.
azureApiVersion String
The Azure API version of the resource.
creationTime String
Gets or sets the creation time.
id String
The provider-assigned unique ID for this managed resource.
lastModifiedBy String
Details of the user who last modified the watcher.
lastModifiedTime String
Gets or sets the last modified time.
name String
The name of the resource
status String
Gets the current status of the watcher.
systemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag String
Gets or sets the etag of the resource.
azureApiVersion string
The Azure API version of the resource.
creationTime string
Gets or sets the creation time.
id string
The provider-assigned unique ID for this managed resource.
lastModifiedBy string
Details of the user who last modified the watcher.
lastModifiedTime string
Gets or sets the last modified time.
name string
The name of the resource
status string
Gets the current status of the watcher.
systemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag string
Gets or sets the etag of the resource.
azure_api_version str
The Azure API version of the resource.
creation_time str
Gets or sets the creation time.
id str
The provider-assigned unique ID for this managed resource.
last_modified_by str
Details of the user who last modified the watcher.
last_modified_time str
Gets or sets the last modified time.
name str
The name of the resource
status str
Gets the current status of the watcher.
system_data SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag str
Gets or sets the etag of the resource.
azureApiVersion String
The Azure API version of the resource.
creationTime String
Gets or sets the creation time.
id String
The provider-assigned unique ID for this managed resource.
lastModifiedBy String
Details of the user who last modified the watcher.
lastModifiedTime String
Gets or sets the last modified time.
name String
The name of the resource
status String
Gets the current status of the watcher.
systemData Property Map
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag String
Gets or sets the etag of the resource.

Supporting Types

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
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 string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
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 string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
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 String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
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 string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
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 String
The type of identity that last modified the resource.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:automation:Watcher MyTestWatcher /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.0.1 published on Monday, Apr 7, 2025 by Pulumi