Share via


az automation source-control

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 source-control command. Learn more about extensions.

Manage source control.

Commands

Name Description Type Status
az automation source-control create

Create a source control.

Extension GA
az automation source-control delete

Delete the source control.

Extension GA
az automation source-control list

List a list of source controls.

Extension GA
az automation source-control show

Get the source control identified by source control name.

Extension GA
az automation source-control sync-job

Manage source control sync jobs.

Extension GA
az automation source-control sync-job create

Create the sync job for a source control.

Extension GA
az automation source-control sync-job list

List a list of source control sync jobs.

Extension GA
az automation source-control sync-job show

Get the source control sync job identified by job id.

Extension GA
az automation source-control sync-job stream

Manage sync job stream.

Extension GA
az automation source-control sync-job stream list

List a list of sync job streams identified by sync job id.

Extension GA
az automation source-control sync-job stream show

Get a sync job stream identified by stream id.

Extension GA
az automation source-control sync-job update

Update the sync job for a source control.

Extension GA
az automation source-control update

Update a source control.

Extension GA

az automation source-control create

Create a source control.

az automation source-control create --account --automation-account-name
                                    --name --source-control-name
                                    --resource-group
                                    [--access-token]
                                    [--auto-sync {0, 1, f, false, n, no, t, true, y, yes}]
                                    [--branch]
                                    [--description]
                                    [--folder-path]
                                    [--publish-runbook {0, 1, f, false, n, no, t, true, y, yes}]
                                    [--refresh-token]
                                    [--repo-url]
                                    [--source-type {GitHub, VsoGit, VsoTfvc}]
                                    [--token-type {Oauth, PersonalAccessToken}]

Examples

Create source control

az automation source-control create -g rg --automation-account-name myAutomationAccount --name source-control --repo-url https://github.com/myAccount/myRepo.git --branch master --source-type GitHub --folder-path / --access-token ghp_MOCKED_GITHUB_TOKEN --token-type PersonalAccessToken --publish-runbook false

Required Parameters

--account --automation-account-name

The name of the automation account.

--name --source-control-name -n

The source control name.

--resource-group -g

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

Optional Parameters

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

--access-token

The access token.

Property Value
Parameter group: SecurityToken Arguments
--auto-sync

The auto async of the source control. Default is false.

Property Value
Parameter group: Properties Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--branch

The repo branch of the source control. Include branch as empty string for VsoTfvc.

Property Value
Parameter group: Properties Arguments
--description

The user description of the source control.

Property Value
Parameter group: Properties Arguments
--folder-path

The folder path of the source control. Path must be relative.

Property Value
Parameter group: Properties Arguments
--publish-runbook

The auto publish of the source control. Default is true.

Property Value
Parameter group: Properties Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--refresh-token

The refresh token.

Property Value
Parameter group: SecurityToken Arguments
--repo-url

The repo url of the source control.

Property Value
Parameter group: Properties Arguments
--source-type

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

Property Value
Parameter group: Properties Arguments
Accepted values: GitHub, VsoGit, VsoTfvc
--token-type

The token type. Must be either PersonalAccessToken or Oauth.

Property Value
Parameter group: SecurityToken Arguments
Accepted values: Oauth, PersonalAccessToken
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 source-control delete

Delete the source control.

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

Examples

Delete the source control

az automation source-control delete -g rg --automation-account-name myAutomationAccount --name sourceControl -y

Optional Parameters

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

--account --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 --source-control-name -n

The name of source control.

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 source-control list

List a list of source controls.

az automation source-control list --account --automation-account-name
                                  --resource-group
                                  [--filter]
                                  [--max-items]
                                  [--next-token]

Examples

List source control

az automation source-control list -g rg --automation-account-name myAutomationAccount

Required Parameters

--account --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>.

Optional Parameters

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

--filter

The filter to apply on the operation.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

Property Value
Parameter group: Pagination Arguments
--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Property Value
Parameter group: Pagination 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.

--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 source-control show

Get the source control identified by source control name.

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

Examples

Get information about the source control

az automation source-control show -g rg --automation-account-name myAutomationAccount --name sourceControl

Optional Parameters

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

--account --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 --source-control-name -n

The name of source control.

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 source-control update

Update a source control.

az automation source-control update [--access-token]
                                    [--account --automation-account-name]
                                    [--add]
                                    [--auto-sync {0, 1, f, false, n, no, t, true, y, yes}]
                                    [--branch]
                                    [--description]
                                    [--folder-path]
                                    [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                    [--ids]
                                    [--name --source-control-name]
                                    [--publish-runbook {0, 1, f, false, n, no, t, true, y, yes}]
                                    [--refresh-token]
                                    [--remove]
                                    [--repo-url]
                                    [--resource-group]
                                    [--set]
                                    [--source-type {GitHub, VsoGit, VsoTfvc}]
                                    [--subscription]
                                    [--token-type {Oauth, PersonalAccessToken}]

Examples

Update source control properties

az automation source-control update -g rg --automation-account-name myAutomationAccount --name sourceControl --access-token ghp_GITHUB_TOKEN --token-type PersonalAccessToken --publish-runbook True

Optional Parameters

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

--access-token

The access token.

Property Value
Parameter group: SecurityToken Arguments
--account --automation-account-name

The name of the automation account.

Property Value
Parameter group: Resource Id Arguments
--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Property Value
Parameter group: Generic Update Arguments
--auto-sync

The auto async of the source control. Default is false.

Property Value
Parameter group: Properties Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--branch

The repo branch of the source control. Include branch as empty string for VsoTfvc.

Property Value
Parameter group: Properties Arguments
--description

The user description of the source control.

Property Value
Parameter group: Properties Arguments
--folder-path

The folder path of the source control. Path must be relative.

Property Value
Parameter group: Properties Arguments
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Property Value
Parameter group: Generic Update Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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 --source-control-name -n

The name of source control.

Property Value
Parameter group: Resource Id Arguments
--publish-runbook

The auto publish of the source control. Default is true.

Property Value
Parameter group: Properties Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--refresh-token

The refresh token.

Property Value
Parameter group: SecurityToken Arguments
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
--repo-url

The repo url of the source control.

Property Value
Parameter group: Properties 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
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
--source-type

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

Property Value
Parameter group: Properties Arguments
Accepted values: GitHub, VsoGit, VsoTfvc
--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
--token-type

The token type. Must be either PersonalAccessToken or Oauth.

Property Value
Parameter group: SecurityToken Arguments
Accepted values: Oauth, PersonalAccessToken
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