Source Control Args
Definition of the source control. Uses Azure REST API version 2023-11-01. In version 2.x of the Azure Native provider, it used API version 2022-08-08. Other available API versions: 2017-05-15-preview, 2019-06-01, 2020-01-13-preview, 2022-08-08, 2023-05-15-preview, 2024-10-23. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native automation [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
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/v3"
"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}
Constructors
Properties
The name of the automation account.
The user description of the source control.
The folder path of the source control. Path must be relative.
The auto publish of the source control. Default is true.
Name of an Azure Resource group.
The authorization token for the repo of the source control.
The source control name.
The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.