SourceControl

class SourceControl : KotlinCustomResource

Definition of the source control. Uses Azure REST API version 2022-08-08. In version 1.x of the Azure Native provider, it used API version 2019-06-01. Other available API versions: 2023-05-15-preview, 2023-11-01, 2024-10-23.

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

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}

Properties

Link copied to clipboard
val autoSync: Output<Boolean>?

The auto sync of the source control. Default is false.

Link copied to clipboard
val branch: Output<String>?

The repo branch of the source control. Include branch as empty string for VsoTfvc.

Link copied to clipboard
val creationTime: Output<String>?

The creation time.

Link copied to clipboard
val description: Output<String>?

The description.

Link copied to clipboard
val folderPath: Output<String>?

The folder path of the source control.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val lastModifiedTime: Output<String>?

The last modified time.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard
val publishRunbook: Output<Boolean>?

The auto publish of the source control. Default is true.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repoUrl: Output<String>?

The repo url of the source control.

Link copied to clipboard
val sourceType: Output<String>?

The source type. Must be one of VsoGit, VsoTfvc, GitHub.

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard
val urn: Output<String>