azure-native.automation.SourceControl
Explore with Pulumi AI
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",
    });
});
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
	})
}
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());
    }
}
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",
});
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")
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
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 string
- The unique name of the resource.
- args SourceControlArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args SourceControlArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SourceControlArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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",
})
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());
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)
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",
});
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
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:
- AutomationAccount stringName 
- The name of the automation account.
- ResourceGroup stringName 
- 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.Azure Native. Automation. Inputs. Source Control Security Token Properties 
- The authorization token for the repo of the source control.
- SourceControl stringName 
- The source control name.
- SourceType string | Pulumi.Azure Native. Automation. Source Type 
- The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- AutomationAccount stringName 
- The name of the automation account.
- ResourceGroup stringName 
- 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 SourceControl Security Token Properties Args 
- The authorization token for the repo of the source control.
- SourceControl stringName 
- The source control name.
- SourceType string | SourceType 
- The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automationAccount StringName 
- The name of the automation account.
- resourceGroup StringName 
- 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 SourceControl Security Token Properties 
- The authorization token for the repo of the source control.
- sourceControl StringName 
- The source control name.
- sourceType String | SourceType 
- The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automationAccount stringName 
- The name of the automation account.
- resourceGroup stringName 
- 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 SourceControl Security Token Properties 
- The authorization token for the repo of the source control.
- sourceControl stringName 
- The source control name.
- sourceType string | SourceType 
- The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automation_account_ strname 
- The name of the automation account.
- resource_group_ strname 
- 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 SourceControl Security Token Properties Args 
- The authorization token for the repo of the source control.
- source_control_ strname 
- The source control name.
- source_type str | SourceType 
- The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automationAccount StringName 
- The name of the automation account.
- resourceGroup StringName 
- 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.
- sourceControl StringName 
- The source control name.
- sourceType String | "VsoGit" | "Vso Tfvc" | "Git Hub" 
- 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.
- LastModified stringTime 
- 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.
- LastModified stringTime 
- 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.
- lastModified StringTime 
- 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.
- lastModified stringTime 
- 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_ strtime 
- 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.
- lastModified StringTime 
- The last modified time.
Supporting Types
SourceControlSecurityTokenProperties, SourceControlSecurityTokenPropertiesArgs          
- AccessToken string
- The access token.
- RefreshToken string
- The refresh token.
- TokenType string | Pulumi.Azure Native. Automation. Token Type 
- 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 | "PersonalAccess Token" | "Oauth" 
- The token type. Must be either PersonalAccessToken or Oauth.
SourceType, SourceTypeArgs    
- VsoGit 
- VsoGit
- VsoTfvc 
- VsoTfvc
- GitHub 
- GitHub
- SourceType Vso Git 
- VsoGit
- SourceType Vso Tfvc 
- VsoTfvc
- SourceType Git Hub 
- 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    
- PersonalAccess Token 
- PersonalAccessToken
- Oauth
- Oauth
- TokenType Personal Access Token 
- PersonalAccessToken
- TokenType Oauth 
- Oauth
- PersonalAccess Token 
- PersonalAccessToken
- Oauth
- Oauth
- PersonalAccess Token 
- PersonalAccessToken
- Oauth
- Oauth
- PERSONAL_ACCESS_TOKEN
- PersonalAccessToken
- OAUTH
- Oauth
- "PersonalAccess Token" 
- 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 
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