1. Packages
  2. Azure Native
  3. API Docs
  4. automation
  5. SourceControl
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi

azure-native.automation.SourceControl

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi

    Definition of the source control. Azure REST API version: 2022-08-08. Prior API version in Azure Native 1.x: 2019-06-01.

    Other available API versions: 2023-05-15-preview, 2023-11-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 = AzureNative.Automation.TokenType.PersonalAccessToken,
            },
            SourceControlName = "sampleSourceControl",
            SourceType = AzureNative.Automation.SourceType.VsoGit,
        });
    
    });
    
    package main
    
    import (
    	automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
    	"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(automation.TokenTypePersonalAccessToken),
    			},
    			SourceControlName: pulumi.String("sampleSourceControl"),
    			SourceType:        pulumi.String(automation.SourceTypeVsoGit),
    		})
    		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 com.pulumi.azurenative.automation.inputs.SourceControlSecurityTokenPropertiesArgs;
    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(SourceControlSecurityTokenPropertiesArgs.builder()
                    .accessToken("******")
                    .tokenType("PersonalAccessToken")
                    .build())
                .sourceControlName("sampleSourceControl")
                .sourceType("VsoGit")
                .build());
    
        }
    }
    
    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={
            "access_token": "******",
            "token_type": azure_native.automation.TokenType.PERSONAL_ACCESS_TOKEN,
        },
        source_control_name="sampleSourceControl",
        source_type=azure_native.automation.SourceType.VSO_GIT)
    
    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: azure_native.automation.TokenType.PersonalAccessToken,
        },
        sourceControlName: "sampleSourceControl",
        sourceType: azure_native.automation.SourceType.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 = new AzureNative.Automation.Inputs.SourceControlSecurityTokenPropertiesArgs
        {
            AccessToken = "string",
            RefreshToken = "string",
            TokenType = "string",
        },
        SourceControlName = "string",
        SourceType = "string",
    });
    
    example, err := automation.NewSourceControl(ctx, "sourceControlResource", &automation.SourceControlArgs{
    	AutomationAccountName: pulumi.String("string"),
    	ResourceGroupName:     pulumi.String("string"),
    	AutoSync:              pulumi.Bool(false),
    	Branch:                pulumi.String("string"),
    	Description:           pulumi.String("string"),
    	FolderPath:            pulumi.String("string"),
    	PublishRunbook:        pulumi.Bool(false),
    	RepoUrl:               pulumi.String("string"),
    	SecurityToken: &automation.SourceControlSecurityTokenPropertiesArgs{
    		AccessToken:  pulumi.String("string"),
    		RefreshToken: pulumi.String("string"),
    		TokenType:    pulumi.String("string"),
    	},
    	SourceControlName: pulumi.String("string"),
    	SourceType:        pulumi.String("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(SourceControlSecurityTokenPropertiesArgs.builder()
            .accessToken("string")
            .refreshToken("string")
            .tokenType("string")
            .build())
        .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={
            "access_token": "string",
            "refresh_token": "string",
            "token_type": "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:

    AutomationAccountName string
    The name of the automation account.
    ResourceGroupName 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 string
    The source control name.
    SourceType string | Pulumi.AzureNative.Automation.SourceType
    The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
    AutomationAccountName string
    The name of the automation account.
    ResourceGroupName 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 string
    The source control name.
    SourceType string | SourceType
    The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
    automationAccountName String
    The name of the automation account.
    resourceGroupName 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 String
    The source control name.
    sourceType String | SourceType
    The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
    automationAccountName string
    The name of the automation account.
    resourceGroupName 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 string
    The source control name.
    sourceType string | SourceType
    The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
    automation_account_name str
    The name of the automation account.
    resource_group_name 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 str
    The source control name.
    source_type str | SourceType
    The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
    automationAccountName String
    The name of the automation account.
    resourceGroupName 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 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName} 
    

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

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi