1. Packages
  2. Azure Native v1
  3. API Docs
  4. automation
  5. SourceControl
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.automation.SourceControl

Explore with Pulumi AI

These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

Definition of the source control. API Version: 2019-06-01.

Example Usage

Create or update a source control

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var sourceControl = new AzureNative.Automation.SourceControl("sourceControl", new()
    {
        AutoSync = true,
        AutomationAccountName = "sampleAccount9",
        Branch = "master",
        Description = "my description",
        FolderPath = "/folderOne/folderTwo",
        PublishRunbook = true,
        RepoUrl = "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
        ResourceGroupName = "rg",
        SecurityToken = new AzureNative.Automation.Inputs.SourceControlSecurityTokenPropertiesArgs
        {
            AccessToken = "******",
            TokenType = "PersonalAccessToken",
        },
        SourceControlName = "sampleSourceControl",
        SourceType = "VsoGit",
    });

});
Copy
package main

import (
	automation "github.com/pulumi/pulumi-azure-native-sdk/automation"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := automation.NewSourceControl(ctx, "sourceControl", &automation.SourceControlArgs{
			AutoSync:              pulumi.Bool(true),
			AutomationAccountName: pulumi.String("sampleAccount9"),
			Branch:                pulumi.String("master"),
			Description:           pulumi.String("my description"),
			FolderPath:            pulumi.String("/folderOne/folderTwo"),
			PublishRunbook:        pulumi.Bool(true),
			RepoUrl:               pulumi.String("https://sampleUser.visualstudio.com/myProject/_git/myRepository"),
			ResourceGroupName:     pulumi.String("rg"),
			SecurityToken: &automation.SourceControlSecurityTokenPropertiesArgs{
				AccessToken: pulumi.String("******"),
				TokenType:   pulumi.String("PersonalAccessToken"),
			},
			SourceControlName: pulumi.String("sampleSourceControl"),
			SourceType:        pulumi.String("VsoGit"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.automation.SourceControl;
import com.pulumi.azurenative.automation.SourceControlArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sourceControl = new SourceControl("sourceControl", SourceControlArgs.builder()        
            .autoSync(true)
            .automationAccountName("sampleAccount9")
            .branch("master")
            .description("my description")
            .folderPath("/folderOne/folderTwo")
            .publishRunbook(true)
            .repoUrl("https://sampleUser.visualstudio.com/myProject/_git/myRepository")
            .resourceGroupName("rg")
            .securityToken(Map.ofEntries(
                Map.entry("accessToken", "******"),
                Map.entry("tokenType", "PersonalAccessToken")
            ))
            .sourceControlName("sampleSourceControl")
            .sourceType("VsoGit")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const sourceControl = new azure_native.automation.SourceControl("sourceControl", {
    autoSync: true,
    automationAccountName: "sampleAccount9",
    branch: "master",
    description: "my description",
    folderPath: "/folderOne/folderTwo",
    publishRunbook: true,
    repoUrl: "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
    resourceGroupName: "rg",
    securityToken: {
        accessToken: "******",
        tokenType: "PersonalAccessToken",
    },
    sourceControlName: "sampleSourceControl",
    sourceType: "VsoGit",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

source_control = azure_native.automation.SourceControl("sourceControl",
    auto_sync=True,
    automation_account_name="sampleAccount9",
    branch="master",
    description="my description",
    folder_path="/folderOne/folderTwo",
    publish_runbook=True,
    repo_url="https://sampleUser.visualstudio.com/myProject/_git/myRepository",
    resource_group_name="rg",
    security_token=azure_native.automation.SourceControlSecurityTokenPropertiesArgs(
        access_token="******",
        token_type="PersonalAccessToken",
    ),
    source_control_name="sampleSourceControl",
    source_type="VsoGit")
Copy
resources:
  sourceControl:
    type: azure-native:automation:SourceControl
    properties:
      autoSync: true
      automationAccountName: sampleAccount9
      branch: master
      description: my description
      folderPath: /folderOne/folderTwo
      publishRunbook: true
      repoUrl: https://sampleUser.visualstudio.com/myProject/_git/myRepository
      resourceGroupName: rg
      securityToken:
        accessToken: '******'
        tokenType: PersonalAccessToken
      sourceControlName: sampleSourceControl
      sourceType: VsoGit
Copy

Create SourceControl Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SourceControl(name: string, args: SourceControlArgs, opts?: CustomResourceOptions);
@overload
def SourceControl(resource_name: str,
                  args: SourceControlArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def SourceControl(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  automation_account_name: Optional[str] = None,
                  resource_group_name: Optional[str] = None,
                  auto_sync: Optional[bool] = None,
                  branch: Optional[str] = None,
                  description: Optional[str] = None,
                  folder_path: Optional[str] = None,
                  publish_runbook: Optional[bool] = None,
                  repo_url: Optional[str] = None,
                  security_token: Optional[SourceControlSecurityTokenPropertiesArgs] = None,
                  source_control_name: Optional[str] = None,
                  source_type: Optional[Union[str, SourceType]] = None)
func NewSourceControl(ctx *Context, name string, args SourceControlArgs, opts ...ResourceOption) (*SourceControl, error)
public SourceControl(string name, SourceControlArgs args, CustomResourceOptions? opts = null)
public SourceControl(String name, SourceControlArgs args)
public SourceControl(String name, SourceControlArgs args, CustomResourceOptions options)
type: azure-native:automation:SourceControl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SourceControlArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SourceControlArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SourceControlArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SourceControlArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SourceControlArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var sourceControlResource = new AzureNative.Automation.SourceControl("sourceControlResource", new()
{
    AutomationAccountName = "string",
    ResourceGroupName = "string",
    AutoSync = false,
    Branch = "string",
    Description = "string",
    FolderPath = "string",
    PublishRunbook = false,
    RepoUrl = "string",
    SecurityToken = 
    {
        { "accessToken", "string" },
        { "refreshToken", "string" },
        { "tokenType", "string" },
    },
    SourceControlName = "string",
    SourceType = "string",
});
Copy
example, err := automation.NewSourceControl(ctx, "sourceControlResource", &automation.SourceControlArgs{
	AutomationAccountName: "string",
	ResourceGroupName:     "string",
	AutoSync:              false,
	Branch:                "string",
	Description:           "string",
	FolderPath:            "string",
	PublishRunbook:        false,
	RepoUrl:               "string",
	SecurityToken: map[string]interface{}{
		"accessToken":  "string",
		"refreshToken": "string",
		"tokenType":    "string",
	},
	SourceControlName: "string",
	SourceType:        "string",
})
Copy
var sourceControlResource = new SourceControl("sourceControlResource", SourceControlArgs.builder()
    .automationAccountName("string")
    .resourceGroupName("string")
    .autoSync(false)
    .branch("string")
    .description("string")
    .folderPath("string")
    .publishRunbook(false)
    .repoUrl("string")
    .securityToken(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .sourceControlName("string")
    .sourceType("string")
    .build());
Copy
source_control_resource = azure_native.automation.SourceControl("sourceControlResource",
    automation_account_name=string,
    resource_group_name=string,
    auto_sync=False,
    branch=string,
    description=string,
    folder_path=string,
    publish_runbook=False,
    repo_url=string,
    security_token={
        accessToken: string,
        refreshToken: string,
        tokenType: string,
    },
    source_control_name=string,
    source_type=string)
Copy
const sourceControlResource = new azure_native.automation.SourceControl("sourceControlResource", {
    automationAccountName: "string",
    resourceGroupName: "string",
    autoSync: false,
    branch: "string",
    description: "string",
    folderPath: "string",
    publishRunbook: false,
    repoUrl: "string",
    securityToken: {
        accessToken: "string",
        refreshToken: "string",
        tokenType: "string",
    },
    sourceControlName: "string",
    sourceType: "string",
});
Copy
type: azure-native:automation:SourceControl
properties:
    autoSync: false
    automationAccountName: string
    branch: string
    description: string
    folderPath: string
    publishRunbook: false
    repoUrl: string
    resourceGroupName: string
    securityToken:
        accessToken: string
        refreshToken: string
        tokenType: string
    sourceControlName: string
    sourceType: string
Copy

SourceControl Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SourceControl resource accepts the following input properties:

AutomationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of an Azure Resource group.
AutoSync bool
The auto async of the source control. Default is false.
Branch string
The repo branch of the source control. Include branch as empty string for VsoTfvc.
Description string
The user description of the source control.
FolderPath string
The folder path of the source control. Path must be relative.
PublishRunbook bool
The auto publish of the source control. Default is true.
RepoUrl string
The repo url of the source control.
SecurityToken Pulumi.AzureNative.Automation.Inputs.SourceControlSecurityTokenProperties
The authorization token for the repo of the source control.
SourceControlName Changes to this property will trigger replacement. string
The source control name.
SourceType string | Pulumi.AzureNative.Automation.SourceType
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
AutomationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of an Azure Resource group.
AutoSync bool
The auto async of the source control. Default is false.
Branch string
The repo branch of the source control. Include branch as empty string for VsoTfvc.
Description string
The user description of the source control.
FolderPath string
The folder path of the source control. Path must be relative.
PublishRunbook bool
The auto publish of the source control. Default is true.
RepoUrl string
The repo url of the source control.
SecurityToken SourceControlSecurityTokenPropertiesArgs
The authorization token for the repo of the source control.
SourceControlName Changes to this property will trigger replacement. string
The source control name.
SourceType string | SourceType
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the automation account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of an Azure Resource group.
autoSync Boolean
The auto async of the source control. Default is false.
branch String
The repo branch of the source control. Include branch as empty string for VsoTfvc.
description String
The user description of the source control.
folderPath String
The folder path of the source control. Path must be relative.
publishRunbook Boolean
The auto publish of the source control. Default is true.
repoUrl String
The repo url of the source control.
securityToken SourceControlSecurityTokenProperties
The authorization token for the repo of the source control.
sourceControlName Changes to this property will trigger replacement. String
The source control name.
sourceType String | SourceType
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of an Azure Resource group.
autoSync boolean
The auto async of the source control. Default is false.
branch string
The repo branch of the source control. Include branch as empty string for VsoTfvc.
description string
The user description of the source control.
folderPath string
The folder path of the source control. Path must be relative.
publishRunbook boolean
The auto publish of the source control. Default is true.
repoUrl string
The repo url of the source control.
securityToken SourceControlSecurityTokenProperties
The authorization token for the repo of the source control.
sourceControlName Changes to this property will trigger replacement. string
The source control name.
sourceType string | SourceType
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
automation_account_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the automation account.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
Name of an Azure Resource group.
auto_sync bool
The auto async of the source control. Default is false.
branch str
The repo branch of the source control. Include branch as empty string for VsoTfvc.
description str
The user description of the source control.
folder_path str
The folder path of the source control. Path must be relative.
publish_runbook bool
The auto publish of the source control. Default is true.
repo_url str
The repo url of the source control.
security_token SourceControlSecurityTokenPropertiesArgs
The authorization token for the repo of the source control.
source_control_name Changes to this property will trigger replacement. str
The source control name.
source_type str | SourceType
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the automation account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of an Azure Resource group.
autoSync Boolean
The auto async of the source control. Default is false.
branch String
The repo branch of the source control. Include branch as empty string for VsoTfvc.
description String
The user description of the source control.
folderPath String
The folder path of the source control. Path must be relative.
publishRunbook Boolean
The auto publish of the source control. Default is true.
repoUrl String
The repo url of the source control.
securityToken Property Map
The authorization token for the repo of the source control.
sourceControlName Changes to this property will trigger replacement. String
The source control name.
sourceType String | "VsoGit" | "VsoTfvc" | "GitHub"
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

Outputs

All input properties are implicitly available as output properties. Additionally, the SourceControl resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource.
CreationTime string
The creation time.
LastModifiedTime string
The last modified time.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource.
CreationTime string
The creation time.
LastModifiedTime string
The last modified time.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource.
creationTime String
The creation time.
lastModifiedTime String
The last modified time.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
type string
The type of the resource.
creationTime string
The creation time.
lastModifiedTime string
The last modified time.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
type str
The type of the resource.
creation_time str
The creation time.
last_modified_time str
The last modified time.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource.
creationTime String
The creation time.
lastModifiedTime String
The last modified time.

Supporting Types

SourceControlSecurityTokenProperties
, SourceControlSecurityTokenPropertiesArgs

AccessToken string
The access token.
RefreshToken string
The refresh token.
TokenType string | Pulumi.AzureNative.Automation.TokenType
The token type. Must be either PersonalAccessToken or Oauth.
AccessToken string
The access token.
RefreshToken string
The refresh token.
TokenType string | TokenType
The token type. Must be either PersonalAccessToken or Oauth.
accessToken String
The access token.
refreshToken String
The refresh token.
tokenType String | TokenType
The token type. Must be either PersonalAccessToken or Oauth.
accessToken string
The access token.
refreshToken string
The refresh token.
tokenType string | TokenType
The token type. Must be either PersonalAccessToken or Oauth.
access_token str
The access token.
refresh_token str
The refresh token.
token_type str | TokenType
The token type. Must be either PersonalAccessToken or Oauth.
accessToken String
The access token.
refreshToken String
The refresh token.
tokenType String | "PersonalAccessToken" | "Oauth"
The token type. Must be either PersonalAccessToken or Oauth.

SourceType
, SourceTypeArgs

VsoGit
VsoGit
VsoTfvc
VsoTfvc
GitHub
GitHub
SourceTypeVsoGit
VsoGit
SourceTypeVsoTfvc
VsoTfvc
SourceTypeGitHub
GitHub
VsoGit
VsoGit
VsoTfvc
VsoTfvc
GitHub
GitHub
VsoGit
VsoGit
VsoTfvc
VsoTfvc
GitHub
GitHub
VSO_GIT
VsoGit
VSO_TFVC
VsoTfvc
GIT_HUB
GitHub
"VsoGit"
VsoGit
"VsoTfvc"
VsoTfvc
"GitHub"
GitHub

TokenType
, TokenTypeArgs

PersonalAccessToken
PersonalAccessToken
Oauth
Oauth
TokenTypePersonalAccessToken
PersonalAccessToken
TokenTypeOauth
Oauth
PersonalAccessToken
PersonalAccessToken
Oauth
Oauth
PersonalAccessToken
PersonalAccessToken
Oauth
Oauth
PERSONAL_ACCESS_TOKEN
PersonalAccessToken
OAUTH
Oauth
"PersonalAccessToken"
PersonalAccessToken
"Oauth"
Oauth

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:automation:SourceControl sampleSourceControl /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v1 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi