แชร์ผ่าน


az automation runbook

Note

This reference is part of the automation extension for the Azure CLI (version 2.55.0 or higher). The extension will automatically install the first time you run an az automation runbook command. Learn more about extensions.

This command group is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Automation Runbook.

Commands

Name Description Type Status
az automation runbook create

Create the runbook identified by runbook name.

Extension Experimental
az automation runbook delete

Delete the runbook by name.

Extension Experimental
az automation runbook list

Retrieve a list of runbooks.

Extension Experimental
az automation runbook publish

Publish runbook draft.

Extension Experimental
az automation runbook replace-content

Replace content of the runbook.

Extension Experimental
az automation runbook revert-to-published

Revert the runbook content to last known published state.

Extension Experimental
az automation runbook show

Retrieve the runbook identified by runbook name.

Extension Experimental
az automation runbook start

Start the runbook.

Extension Experimental
az automation runbook update

Update the runbook identified by runbook name.

Extension Experimental
az automation runbook wait

Place the CLI in a waiting state until a condition of the automation runbook is met.

Extension Experimental

az automation runbook create

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create the runbook identified by runbook name.

az automation runbook create --automation-account-name
                             --name --runbook-name
                             --resource-group
                             --type {Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShell, PowerShellWorkflow, Python2, Python3, Script}
                             [--description]
                             [--location]
                             [--log-activity-trace]
                             [--log-progress {false, true}]
                             [--log-verbose {false, true}]
                             [--tags]

Examples

Create a runbook

az automation runbook create --automation-account-name "myAutomationAccount" --resource-group "rg"                --name "myRunbook" --type "PowerShell" --location "East US 2"

Required Parameters

--automation-account-name

The name of the automation account.

--name --runbook-name -n

The runbook name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--type

Type of the runbook.

Property Value
Accepted values: Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShell, PowerShellWorkflow, Python2, Python3, Script

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--description

Description of the runbook.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--log-activity-trace

Activity level tracing options of the runbook.

--log-progress

Progress log option of the runbook.

Property Value
Accepted values: false, true
--log-verbose

Verbose log option of the runbook.

Property Value
Accepted values: false, true
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook delete

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete the runbook by name.

az automation runbook delete [--automation-account-name]
                             [--ids]
                             [--name --runbook-name]
                             [--resource-group]
                             [--subscription]
                             [--yes]

Examples

Delete a runbook

az automation runbook delete --automation-account-name "myAutomationAccount" --resource-group "rg"                --name "myRunbook"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook list

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Retrieve a list of runbooks.

az automation runbook list --automation-account-name
                           --resource-group

Examples

List runbooks by automation account

az automation runbook list --automation-account-name "myAutomationAccount" --resource-group "rg"

Required Parameters

--automation-account-name

The name of the automation account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook publish

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Publish runbook draft.

az automation runbook publish [--automation-account-name]
                              [--ids]
                              [--name --runbook-name]
                              [--no-wait]
                              [--resource-group]
                              [--subscription]

Examples

Publish runbook draft

az automation runbook publish --automation-account-name "myAutomationAccount" --resource-group                "rg" --name "myRunbook"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --runbook-name -n

The parameters supplied to the publish runbook operation.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook replace-content

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Replace content of the runbook.

az automation runbook replace-content --content
                                      [--automation-account-name]
                                      [--ids]
                                      [--name --runbook-name]
                                      [--no-wait]
                                      [--resource-group]
                                      [--subscription]

Examples

Replace content of the runbook

az automation runbook replace-content --automation-account-name "myAutomationAccount" --resource-group                "rg" --name "myRunbook" --content @/path/to/script

Required Parameters

--content

The runbook content.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook revert-to-published

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Revert the runbook content to last known published state.

az automation runbook revert-to-published [--automation-account-name]
                                          [--ids]
                                          [--name --runbook-name]
                                          [--resource-group]
                                          [--subscription]

Examples

Replace content of the runbook

az automation runbook revert-to-published --automation-account-name "myAutomationAccount"                --resource-group "rg" --name "myRunbook"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook show

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Retrieve the runbook identified by runbook name.

az automation runbook show [--automation-account-name]
                           [--ids]
                           [--name --runbook-name]
                           [--resource-group]
                           [--subscription]

Examples

Get runbook

az automation runbook show --automation-account-name "myAutomationAccount" --resource-group "rg"                --name "myRunbook"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook start

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Start the runbook.

az automation runbook start [--automation-account-name]
                            [--ids]
                            [--name --runbook-name]
                            [--parameters]
                            [--resource-group]
                            [--run-on]
                            [--subscription]

Examples

Start the runbook

az automation runbook start --automation-account-name "myAutomationAccount" --resource-group "rg"                --name "myRunbook"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--parameters

Parameters of the job. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--run-on

RunOn which specifies the group name where the job is to be executed.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook update

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update the runbook identified by runbook name.

az automation runbook update [--automation-account-name]
                             [--description]
                             [--ids]
                             [--log-activity-trace]
                             [--log-progress {false, true}]
                             [--log-verbose {false, true}]
                             [--name --runbook-name]
                             [--resource-group]
                             [--subscription]
                             [--tags]

Examples

Update a runbook

az automation runbook update --automation-account-name "myAutomationAccount" --description                "Runbook Description" --log-activity-trace 1 --log-progress true --log-verbose false                --resource-group "rg" --runbook-name "myRunbook"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--description

Description of the runbook.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--log-activity-trace

Activity level tracing options of the runbook.

--log-progress

Progress log option of the runbook.

Property Value
Accepted values: false, true
--log-verbose

Verbose log option of the runbook.

Property Value
Accepted values: false, true
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az automation runbook wait

Experimental

Command group 'automation runbook' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Place the CLI in a waiting state until a condition of the automation runbook is met.

az automation runbook wait [--automation-account-name]
                           [--created]
                           [--custom]
                           [--deleted]
                           [--exists]
                           [--ids]
                           [--interval]
                           [--name --runbook-name]
                           [--resource-group]
                           [--subscription]
                           [--timeout]
                           [--updated]

Examples

Pause executing next line of CLI script until the automation runbook is successfully created.

az automation runbook wait --automation-account-name "myAutomationAccount" --resource-group "rg"                --name "myRunbook" --created

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--created

Wait until created with 'provisioningState' at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

Property Value
Parameter group: Wait Condition Arguments
--deleted

Wait until deleted.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--exists

Wait until the resource exists.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--interval

Polling interval in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 30
--name --runbook-name -n

The runbook name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--timeout

Maximum wait in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False