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=2024-10-23
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
automation
|
path | True |
string |
The name of the automation account. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._]+$ |
Name of an Azure Resource group. |
|
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=2024-10-23
{
"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 |
|---|---|
|
created |
The type of identity that created the resource. |
|
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. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
token |
The token type. Must be either PersonalAccessToken or Oauth. |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
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 (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| 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 (date-time) |
The creation time. |
| properties.description |
string |
The description. |
| properties.folderPath |
string |
The folder path of the source control. |
| properties.lastModifiedTime |
string (date-time) |
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. |
|
| systemData |
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" |
SourceControlSecurityTokenProperties
| Name | Type | Description |
|---|---|---|
| accessToken |
string maxLength: 1024 |
The access token. |
| refreshToken |
string maxLength: 1024 |
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.
| Value | Description |
|---|---|
| VsoGit | |
| VsoTfvc | |
| GitHub |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
tokenType
The token type. Must be either PersonalAccessToken or Oauth.
| Value | Description |
|---|---|
| PersonalAccessToken | |
| Oauth |