Source Control - Update
Update a source control.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}?api-version=2023-11-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
automation
|
path | True |
string |
The name of the automation account. |
resource
|
path | True |
string |
Name of an Azure Resource group. Regex pattern: |
source
|
path | True |
string |
The source control name. |
subscription
|
path | True |
string |
Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
api-version
|
query | True |
string |
Client Api Version. |
Request Body
Name | Type | Description |
---|---|---|
properties.autoSync |
boolean |
The auto sync of the source control. Default is false. |
properties.branch |
string |
The repo branch of the source control. |
properties.description |
string |
The user description of the source control. |
properties.folderPath |
string |
The folder path of the source control. Path must be relative. |
properties.publishRunbook |
boolean |
The auto publish of the source control. Default is true. |
properties.securityToken |
The authorization token for the repo of the source control. |
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 a source control
Sample request
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourceControls/sampleSourceControl?api-version=2023-11-01
{
"properties": {
"branch": "master",
"folderPath": "/folderOne/folderTwo",
"autoSync": true,
"publishRunbook": true,
"securityToken": {
"accessToken": "******",
"tokenType": "PersonalAccessToken"
},
"description": "my description"
}
}
Sample response
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl",
"name": "sampleSourceControl",
"properties": {
"creationTime": "2017-03-28T22:59:00.937+00:00",
"lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
"repoUrl": "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
"branch": "master",
"folderPath": "/folderOne/folderTwo",
"autoSync": true,
"publishRunbook": true,
"sourceType": "VsoGit",
"description": "my description"
}
}
Definitions
Name | Description |
---|---|
Error |
Error response of an operation failure |
Source |
Definition of the source control. |
Source |
|
Source |
The parameters supplied to the update source control operation. |
source |
The source type. Must be one of VsoGit, VsoTfvc, GitHub. |
token |
The token type. Must be either PersonalAccessToken or Oauth. |
ErrorResponse
Error response of an operation failure
Name | Type | Description |
---|---|---|
code |
string |
Error code |
message |
string |
Error message indicating why the operation failed. |
SourceControl
Definition of the source control.
Name | Type | Description |
---|---|---|
id |
string |
Fully qualified resource Id for the resource |
name |
string |
The name of the resource |
properties.autoSync |
boolean |
The auto sync of the source control. Default is false. |
properties.branch |
string |
The repo branch of the source control. Include branch as empty string for VsoTfvc. |
properties.creationTime |
string |
The creation time. |
properties.description |
string |
The description. |
properties.folderPath |
string |
The folder path of the source control. |
properties.lastModifiedTime |
string |
The last modified time. |
properties.publishRunbook |
boolean |
The auto publish of the source control. Default is true. |
properties.repoUrl |
string |
The repo url of the source control. |
properties.sourceType |
The source type. Must be one of VsoGit, VsoTfvc, GitHub. |
|
type |
string |
The type of the resource. |
SourceControlSecurityTokenProperties
Name | Type | Description |
---|---|---|
accessToken |
string |
The access token. |
refreshToken |
string |
The refresh token. |
tokenType |
The token type. Must be either PersonalAccessToken or Oauth. |
SourceControlUpdateParameters
The parameters supplied to the update source control operation.
Name | Type | Description |
---|---|---|
properties.autoSync |
boolean |
The auto sync of the source control. Default is false. |
properties.branch |
string |
The repo branch of the source control. |
properties.description |
string |
The user description of the source control. |
properties.folderPath |
string |
The folder path of the source control. Path must be relative. |
properties.publishRunbook |
boolean |
The auto publish of the source control. Default is true. |
properties.securityToken |
The authorization token for the repo of the source control. |
sourceType
The source type. Must be one of VsoGit, VsoTfvc, GitHub.
Name | Type | Description |
---|---|---|
GitHub |
string |
|
VsoGit |
string |
|
VsoTfvc |
string |
tokenType
The token type. Must be either PersonalAccessToken or Oauth.
Name | Type | Description |
---|---|---|
Oauth |
string |
|
PersonalAccessToken |
string |