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 |
The name of the resource group. The name is case insensitive. |
|
source
|
path | True |
string |
The name of source control. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
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 |
Azure operation completed successfully. |
|
| Other Status Codes |
An unexpected error response. |
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/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourceControls/sampleSourceControl?api-version=2024-10-23
{
"properties": {
"description": "my description",
"autoSync": true,
"branch": "master",
"folderPath": "/folderOne/folderTwo",
"publishRunbook": true,
"securityToken": {
"accessToken": "******",
"tokenType": "PersonalAccessToken"
}
}
}
Sample response
{
"name": "sampleSourceControl",
"id": "/subscriptions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl",
"properties": {
"description": "my description",
"autoSync": true,
"branch": "master",
"creationTime": "2017-03-28T22:59:00.937+00:00",
"folderPath": "/folderOne/folderTwo",
"lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
"publishRunbook": true,
"repoUrl": "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
"sourceType": "VsoGit"
}
}
Definitions
| Name | Description |
|---|---|
|
created |
The type of identity that created the resource. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
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 |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
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 |
VsoGit |
| VsoTfvc |
VsoTfvc |
| GitHub |
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 |
PersonalAccessToken |
| Oauth |
Oauth |