Task
The task that has the ARM resource and task properties. The task will have all information to schedule a run against it. Azure REST API version: 2019-06-01-preview. Prior API version in Azure Native 1.x: 2019-06-01-preview. Other available API versions: 2018-09-01, 2019-04-01.
Example Usage
Tasks_Create
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var task = new AzureNative.ContainerRegistry.Task("task", new()
{
AgentConfiguration = new AzureNative.ContainerRegistry.Inputs.AgentPropertiesArgs
{
Cpu = 2,
},
Identity = new AzureNative.ContainerRegistry.Inputs.IdentityPropertiesArgs
{
Type = AzureNative.ContainerRegistry.ResourceIdentityType.SystemAssigned,
},
IsSystemTask = false,
Location = "eastus",
LogTemplate = "acr/tasks:{{.Run.OS}}",
Platform = new AzureNative.ContainerRegistry.Inputs.PlatformPropertiesArgs
{
Architecture = "amd64",
Os = "Linux",
},
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Status = "Enabled",
Step = new AzureNative.ContainerRegistry.Inputs.DockerBuildStepArgs
{
Arguments = new[]
{
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = false,
Name = "mytestargument",
Value = "mytestvalue",
},
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = true,
Name = "mysecrettestargument",
Value = "mysecrettestvalue",
},
},
ContextPath = "src",
DockerFilePath = "src/DockerFile",
ImageNames = new[]
{
"azurerest:testtag",
},
IsPushEnabled = true,
NoCache = false,
Type = "Docker",
},
Tags =
{
{ "testkey", "value" },
},
TaskName = "mytTask",
Trigger = new AzureNative.ContainerRegistry.Inputs.TriggerPropertiesArgs
{
BaseImageTrigger = new AzureNative.ContainerRegistry.Inputs.BaseImageTriggerArgs
{
BaseImageTriggerType = "Runtime",
Name = "myBaseImageTrigger",
UpdateTriggerEndpoint = "https://user:pass@mycicd.webhook.com?token=foo",
UpdateTriggerPayloadType = "Token",
},
SourceTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.SourceTriggerArgs
{
Name = "mySourceTrigger",
SourceRepository = new AzureNative.ContainerRegistry.Inputs.SourcePropertiesArgs
{
Branch = "master",
RepositoryUrl = "https://github.com/Azure/azure-rest-api-specs",
SourceControlAuthProperties = new AzureNative.ContainerRegistry.Inputs.AuthInfoArgs
{
Token = "xxxxx",
TokenType = "PAT",
},
SourceControlType = "Github",
},
SourceTriggerEvents = new[]
{
"commit",
},
},
},
TimerTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.TimerTriggerArgs
{
Name = "myTimerTrigger",
Schedule = "30 9 * * 1-5",
},
},
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewTask(ctx, "task", &containerregistry.TaskArgs{
AgentConfiguration: &containerregistry.AgentPropertiesArgs{
Cpu: pulumi.Int(2),
},
Identity: &containerregistry.IdentityPropertiesArgs{
Type: containerregistry.ResourceIdentityTypeSystemAssigned,
},
IsSystemTask: pulumi.Bool(false),
Location: pulumi.String("eastus"),
LogTemplate: pulumi.String("acr/tasks:{{.Run.OS}}"),
Platform: &containerregistry.PlatformPropertiesArgs{
Architecture: pulumi.String("amd64"),
Os: pulumi.String("Linux"),
},
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Status: pulumi.String("Enabled"),
Step: containerregistry.DockerBuildStep{
Arguments: []containerregistry.Argument{
{
IsSecret: false,
Name: "mytestargument",
Value: "mytestvalue",
},
{
IsSecret: true,
Name: "mysecrettestargument",
Value: "mysecrettestvalue",
},
},
ContextPath: "src",
DockerFilePath: "src/DockerFile",
ImageNames: []string{
"azurerest:testtag",
},
IsPushEnabled: true,
NoCache: false,
Type: "Docker",
},
Tags: pulumi.StringMap{
"testkey": pulumi.String("value"),
},
TaskName: pulumi.String("mytTask"),
Trigger: containerregistry.TriggerPropertiesResponse{
BaseImageTrigger: &containerregistry.BaseImageTriggerArgs{
BaseImageTriggerType: pulumi.String("Runtime"),
Name: pulumi.String("myBaseImageTrigger"),
UpdateTriggerEndpoint: pulumi.String("https://user:pass@mycicd.webhook.com?token=foo"),
UpdateTriggerPayloadType: pulumi.String("Token"),
},
SourceTriggers: containerregistry.SourceTriggerArray{
interface{}{
Name: pulumi.String("mySourceTrigger"),
SourceRepository: interface{}{
Branch: pulumi.String("master"),
RepositoryUrl: pulumi.String("https://github.com/Azure/azure-rest-api-specs"),
SourceControlAuthProperties: &containerregistry.AuthInfoArgs{
Token: pulumi.String("xxxxx"),
TokenType: pulumi.String("PAT"),
},
SourceControlType: pulumi.String("Github"),
},
SourceTriggerEvents: pulumi.StringArray{
pulumi.String("commit"),
},
},
},
TimerTriggers: containerregistry.TimerTriggerArray{
&containerregistry.TimerTriggerArgs{
Name: pulumi.String("myTimerTrigger"),
Schedule: pulumi.String("30 9 * * 1-5"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.Task;
import com.pulumi.azurenative.containerregistry.TaskArgs;
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 task = new Task("task", TaskArgs.builder()
.agentConfiguration(Map.of("cpu", 2))
.identity(Map.of("type", "SystemAssigned"))
.isSystemTask(false)
.location("eastus")
.logTemplate("acr/tasks:{{.Run.OS}}")
.platform(Map.ofEntries(
Map.entry("architecture", "amd64"),
Map.entry("os", "Linux")
))
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.status("Enabled")
.step(Map.ofEntries(
Map.entry("arguments",
Map.ofEntries(
Map.entry("isSecret", false),
Map.entry("name", "mytestargument"),
Map.entry("value", "mytestvalue")
),
Map.ofEntries(
Map.entry("isSecret", true),
Map.entry("name", "mysecrettestargument"),
Map.entry("value", "mysecrettestvalue")
)),
Map.entry("contextPath", "src"),
Map.entry("dockerFilePath", "src/DockerFile"),
Map.entry("imageNames", "azurerest:testtag"),
Map.entry("isPushEnabled", true),
Map.entry("noCache", false),
Map.entry("type", "Docker")
))
.tags(Map.of("testkey", "value"))
.taskName("mytTask")
.trigger(Map.ofEntries(
Map.entry("baseImageTrigger", Map.ofEntries(
Map.entry("baseImageTriggerType", "Runtime"),
Map.entry("name", "myBaseImageTrigger"),
Map.entry("updateTriggerEndpoint", "https://user:pass@mycicd.webhook.com?token=foo"),
Map.entry("updateTriggerPayloadType", "Token")
)),
Map.entry("sourceTriggers", Map.ofEntries(
Map.entry("name", "mySourceTrigger"),
Map.entry("sourceRepository", Map.ofEntries(
Map.entry("branch", "master"),
Map.entry("repositoryUrl", "https://github.com/Azure/azure-rest-api-specs"),
Map.entry("sourceControlAuthProperties", Map.ofEntries(
Map.entry("token", "xxxxx"),
Map.entry("tokenType", "PAT")
)),
Map.entry("sourceControlType", "Github")
)),
Map.entry("sourceTriggerEvents", "commit")
)),
Map.entry("timerTriggers", Map.ofEntries(
Map.entry("name", "myTimerTrigger"),
Map.entry("schedule", "30 9 * * 1-5")
))
))
.build());
}
}
Content copied to clipboard
Tasks_Create_QuickTask
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var task = new AzureNative.ContainerRegistry.Task("task", new()
{
IsSystemTask = true,
Location = "eastus",
LogTemplate = "acr/tasks:{{.Run.OS}}",
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Status = "Enabled",
Tags =
{
{ "testkey", "value" },
},
TaskName = "quicktask",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewTask(ctx, "task", &containerregistry.TaskArgs{
IsSystemTask: pulumi.Bool(true),
Location: pulumi.String("eastus"),
LogTemplate: pulumi.String("acr/tasks:{{.Run.OS}}"),
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Status: pulumi.String("Enabled"),
Tags: pulumi.StringMap{
"testkey": pulumi.String("value"),
},
TaskName: pulumi.String("quicktask"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.Task;
import com.pulumi.azurenative.containerregistry.TaskArgs;
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 task = new Task("task", TaskArgs.builder()
.isSystemTask(true)
.location("eastus")
.logTemplate("acr/tasks:{{.Run.OS}}")
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.status("Enabled")
.tags(Map.of("testkey", "value"))
.taskName("quicktask")
.build());
}
}
Content copied to clipboard
Tasks_Create_WithSystemAndUserIdentities
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var task = new AzureNative.ContainerRegistry.Task("task", new()
{
AgentConfiguration = new AzureNative.ContainerRegistry.Inputs.AgentPropertiesArgs
{
Cpu = 2,
},
Identity = new AzureNative.ContainerRegistry.Inputs.IdentityPropertiesArgs
{
Type = AzureNative.ContainerRegistry.ResourceIdentityType.SystemAssigned_UserAssigned,
UserAssignedIdentities =
{
{ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", null },
},
},
IsSystemTask = false,
Location = "eastus",
Platform = new AzureNative.ContainerRegistry.Inputs.PlatformPropertiesArgs
{
Architecture = "amd64",
Os = "Linux",
},
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Status = "Enabled",
Step = new AzureNative.ContainerRegistry.Inputs.DockerBuildStepArgs
{
Arguments = new[]
{
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = false,
Name = "mytestargument",
Value = "mytestvalue",
},
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = true,
Name = "mysecrettestargument",
Value = "mysecrettestvalue",
},
},
ContextPath = "src",
DockerFilePath = "src/DockerFile",
ImageNames = new[]
{
"azurerest:testtag",
},
IsPushEnabled = true,
NoCache = false,
Type = "Docker",
},
Tags =
{
{ "testkey", "value" },
},
TaskName = "mytTask",
Trigger = new AzureNative.ContainerRegistry.Inputs.TriggerPropertiesArgs
{
BaseImageTrigger = new AzureNative.ContainerRegistry.Inputs.BaseImageTriggerArgs
{
BaseImageTriggerType = "Runtime",
Name = "myBaseImageTrigger",
UpdateTriggerEndpoint = "https://user:pass@mycicd.webhook.com?token=foo",
UpdateTriggerPayloadType = "Default",
},
SourceTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.SourceTriggerArgs
{
Name = "mySourceTrigger",
SourceRepository = new AzureNative.ContainerRegistry.Inputs.SourcePropertiesArgs
{
Branch = "master",
RepositoryUrl = "https://github.com/Azure/azure-rest-api-specs",
SourceControlAuthProperties = new AzureNative.ContainerRegistry.Inputs.AuthInfoArgs
{
Token = "xxxxx",
TokenType = "PAT",
},
SourceControlType = "Github",
},
SourceTriggerEvents = new[]
{
"commit",
},
},
},
TimerTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.TimerTriggerArgs
{
Name = "myTimerTrigger",
Schedule = "30 9 * * 1-5",
},
},
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewTask(ctx, "task", &containerregistry.TaskArgs{
AgentConfiguration: &containerregistry.AgentPropertiesArgs{
Cpu: pulumi.Int(2),
},
Identity: containerregistry.IdentityPropertiesResponse{
Type: containerregistry.ResourceIdentityType_SystemAssigned_UserAssigned,
UserAssignedIdentities: containerregistry.UserIdentityPropertiesMap{
"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": nil,
},
},
IsSystemTask: pulumi.Bool(false),
Location: pulumi.String("eastus"),
Platform: &containerregistry.PlatformPropertiesArgs{
Architecture: pulumi.String("amd64"),
Os: pulumi.String("Linux"),
},
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Status: pulumi.String("Enabled"),
Step: containerregistry.DockerBuildStep{
Arguments: []containerregistry.Argument{
{
IsSecret: false,
Name: "mytestargument",
Value: "mytestvalue",
},
{
IsSecret: true,
Name: "mysecrettestargument",
Value: "mysecrettestvalue",
},
},
ContextPath: "src",
DockerFilePath: "src/DockerFile",
ImageNames: []string{
"azurerest:testtag",
},
IsPushEnabled: true,
NoCache: false,
Type: "Docker",
},
Tags: pulumi.StringMap{
"testkey": pulumi.String("value"),
},
TaskName: pulumi.String("mytTask"),
Trigger: containerregistry.TriggerPropertiesResponse{
BaseImageTrigger: &containerregistry.BaseImageTriggerArgs{
BaseImageTriggerType: pulumi.String("Runtime"),
Name: pulumi.String("myBaseImageTrigger"),
UpdateTriggerEndpoint: pulumi.String("https://user:pass@mycicd.webhook.com?token=foo"),
UpdateTriggerPayloadType: pulumi.String("Default"),
},
SourceTriggers: containerregistry.SourceTriggerArray{
interface{}{
Name: pulumi.String("mySourceTrigger"),
SourceRepository: interface{}{
Branch: pulumi.String("master"),
RepositoryUrl: pulumi.String("https://github.com/Azure/azure-rest-api-specs"),
SourceControlAuthProperties: &containerregistry.AuthInfoArgs{
Token: pulumi.String("xxxxx"),
TokenType: pulumi.String("PAT"),
},
SourceControlType: pulumi.String("Github"),
},
SourceTriggerEvents: pulumi.StringArray{
pulumi.String("commit"),
},
},
},
TimerTriggers: containerregistry.TimerTriggerArray{
&containerregistry.TimerTriggerArgs{
Name: pulumi.String("myTimerTrigger"),
Schedule: pulumi.String("30 9 * * 1-5"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.Task;
import com.pulumi.azurenative.containerregistry.TaskArgs;
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 task = new Task("task", TaskArgs.builder()
.agentConfiguration(Map.of("cpu", 2))
.identity(Map.ofEntries(
Map.entry("type", "SystemAssigned, UserAssigned"),
Map.entry("userAssignedIdentities", Map.of("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", ))
))
.isSystemTask(false)
.location("eastus")
.platform(Map.ofEntries(
Map.entry("architecture", "amd64"),
Map.entry("os", "Linux")
))
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.status("Enabled")
.step(Map.ofEntries(
Map.entry("arguments",
Map.ofEntries(
Map.entry("isSecret", false),
Map.entry("name", "mytestargument"),
Map.entry("value", "mytestvalue")
),
Map.ofEntries(
Map.entry("isSecret", true),
Map.entry("name", "mysecrettestargument"),
Map.entry("value", "mysecrettestvalue")
)),
Map.entry("contextPath", "src"),
Map.entry("dockerFilePath", "src/DockerFile"),
Map.entry("imageNames", "azurerest:testtag"),
Map.entry("isPushEnabled", true),
Map.entry("noCache", false),
Map.entry("type", "Docker")
))
.tags(Map.of("testkey", "value"))
.taskName("mytTask")
.trigger(Map.ofEntries(
Map.entry("baseImageTrigger", Map.ofEntries(
Map.entry("baseImageTriggerType", "Runtime"),
Map.entry("name", "myBaseImageTrigger"),
Map.entry("updateTriggerEndpoint", "https://user:pass@mycicd.webhook.com?token=foo"),
Map.entry("updateTriggerPayloadType", "Default")
)),
Map.entry("sourceTriggers", Map.ofEntries(
Map.entry("name", "mySourceTrigger"),
Map.entry("sourceRepository", Map.ofEntries(
Map.entry("branch", "master"),
Map.entry("repositoryUrl", "https://github.com/Azure/azure-rest-api-specs"),
Map.entry("sourceControlAuthProperties", Map.ofEntries(
Map.entry("token", "xxxxx"),
Map.entry("tokenType", "PAT")
)),
Map.entry("sourceControlType", "Github")
)),
Map.entry("sourceTriggerEvents", "commit")
)),
Map.entry("timerTriggers", Map.ofEntries(
Map.entry("name", "myTimerTrigger"),
Map.entry("schedule", "30 9 * * 1-5")
))
))
.build());
}
}
Content copied to clipboard
Tasks_Create_WithUserIdentities
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var task = new AzureNative.ContainerRegistry.Task("task", new()
{
AgentConfiguration = new AzureNative.ContainerRegistry.Inputs.AgentPropertiesArgs
{
Cpu = 2,
},
Identity = new AzureNative.ContainerRegistry.Inputs.IdentityPropertiesArgs
{
Type = AzureNative.ContainerRegistry.ResourceIdentityType.UserAssigned,
UserAssignedIdentities =
{
{ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", null },
{ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", null },
},
},
IsSystemTask = false,
Location = "eastus",
Platform = new AzureNative.ContainerRegistry.Inputs.PlatformPropertiesArgs
{
Architecture = "amd64",
Os = "Linux",
},
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Status = "Enabled",
Step = new AzureNative.ContainerRegistry.Inputs.DockerBuildStepArgs
{
Arguments = new[]
{
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = false,
Name = "mytestargument",
Value = "mytestvalue",
},
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = true,
Name = "mysecrettestargument",
Value = "mysecrettestvalue",
},
},
ContextPath = "src",
DockerFilePath = "src/DockerFile",
ImageNames = new[]
{
"azurerest:testtag",
},
IsPushEnabled = true,
NoCache = false,
Type = "Docker",
},
Tags =
{
{ "testkey", "value" },
},
TaskName = "mytTask",
Trigger = new AzureNative.ContainerRegistry.Inputs.TriggerPropertiesArgs
{
BaseImageTrigger = new AzureNative.ContainerRegistry.Inputs.BaseImageTriggerArgs
{
BaseImageTriggerType = "Runtime",
Name = "myBaseImageTrigger",
UpdateTriggerEndpoint = "https://user:pass@mycicd.webhook.com?token=foo",
UpdateTriggerPayloadType = "Default",
},
SourceTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.SourceTriggerArgs
{
Name = "mySourceTrigger",
SourceRepository = new AzureNative.ContainerRegistry.Inputs.SourcePropertiesArgs
{
Branch = "master",
RepositoryUrl = "https://github.com/Azure/azure-rest-api-specs",
SourceControlAuthProperties = new AzureNative.ContainerRegistry.Inputs.AuthInfoArgs
{
Token = "xxxxx",
TokenType = "PAT",
},
SourceControlType = "Github",
},
SourceTriggerEvents = new[]
{
"commit",
},
},
},
TimerTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.TimerTriggerArgs
{
Name = "myTimerTrigger",
Schedule = "30 9 * * 1-5",
},
},
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewTask(ctx, "task", &containerregistry.TaskArgs{
AgentConfiguration: &containerregistry.AgentPropertiesArgs{
Cpu: pulumi.Int(2),
},
Identity: containerregistry.IdentityPropertiesResponse{
Type: containerregistry.ResourceIdentityTypeUserAssigned,
UserAssignedIdentities: containerregistry.UserIdentityPropertiesMap{
"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": nil,
"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": nil,
},
},
IsSystemTask: pulumi.Bool(false),
Location: pulumi.String("eastus"),
Platform: &containerregistry.PlatformPropertiesArgs{
Architecture: pulumi.String("amd64"),
Os: pulumi.String("Linux"),
},
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Status: pulumi.String("Enabled"),
Step: containerregistry.DockerBuildStep{
Arguments: []containerregistry.Argument{
{
IsSecret: false,
Name: "mytestargument",
Value: "mytestvalue",
},
{
IsSecret: true,
Name: "mysecrettestargument",
Value: "mysecrettestvalue",
},
},
ContextPath: "src",
DockerFilePath: "src/DockerFile",
ImageNames: []string{
"azurerest:testtag",
},
IsPushEnabled: true,
NoCache: false,
Type: "Docker",
},
Tags: pulumi.StringMap{
"testkey": pulumi.String("value"),
},
TaskName: pulumi.String("mytTask"),
Trigger: containerregistry.TriggerPropertiesResponse{
BaseImageTrigger: &containerregistry.BaseImageTriggerArgs{
BaseImageTriggerType: pulumi.String("Runtime"),
Name: pulumi.String("myBaseImageTrigger"),
UpdateTriggerEndpoint: pulumi.String("https://user:pass@mycicd.webhook.com?token=foo"),
UpdateTriggerPayloadType: pulumi.String("Default"),
},
SourceTriggers: containerregistry.SourceTriggerArray{
interface{}{
Name: pulumi.String("mySourceTrigger"),
SourceRepository: interface{}{
Branch: pulumi.String("master"),
RepositoryUrl: pulumi.String("https://github.com/Azure/azure-rest-api-specs"),
SourceControlAuthProperties: &containerregistry.AuthInfoArgs{
Token: pulumi.String("xxxxx"),
TokenType: pulumi.String("PAT"),
},
SourceControlType: pulumi.String("Github"),
},
SourceTriggerEvents: pulumi.StringArray{
pulumi.String("commit"),
},
},
},
TimerTriggers: containerregistry.TimerTriggerArray{
&containerregistry.TimerTriggerArgs{
Name: pulumi.String("myTimerTrigger"),
Schedule: pulumi.String("30 9 * * 1-5"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.Task;
import com.pulumi.azurenative.containerregistry.TaskArgs;
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 task = new Task("task", TaskArgs.builder()
.agentConfiguration(Map.of("cpu", 2))
.identity(Map.ofEntries(
Map.entry("type", "UserAssigned"),
Map.entry("userAssignedIdentities", Map.ofEntries(
Map.entry("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", ),
Map.entry("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", )
))
))
.isSystemTask(false)
.location("eastus")
.platform(Map.ofEntries(
Map.entry("architecture", "amd64"),
Map.entry("os", "Linux")
))
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.status("Enabled")
.step(Map.ofEntries(
Map.entry("arguments",
Map.ofEntries(
Map.entry("isSecret", false),
Map.entry("name", "mytestargument"),
Map.entry("value", "mytestvalue")
),
Map.ofEntries(
Map.entry("isSecret", true),
Map.entry("name", "mysecrettestargument"),
Map.entry("value", "mysecrettestvalue")
)),
Map.entry("contextPath", "src"),
Map.entry("dockerFilePath", "src/DockerFile"),
Map.entry("imageNames", "azurerest:testtag"),
Map.entry("isPushEnabled", true),
Map.entry("noCache", false),
Map.entry("type", "Docker")
))
.tags(Map.of("testkey", "value"))
.taskName("mytTask")
.trigger(Map.ofEntries(
Map.entry("baseImageTrigger", Map.ofEntries(
Map.entry("baseImageTriggerType", "Runtime"),
Map.entry("name", "myBaseImageTrigger"),
Map.entry("updateTriggerEndpoint", "https://user:pass@mycicd.webhook.com?token=foo"),
Map.entry("updateTriggerPayloadType", "Default")
)),
Map.entry("sourceTriggers", Map.ofEntries(
Map.entry("name", "mySourceTrigger"),
Map.entry("sourceRepository", Map.ofEntries(
Map.entry("branch", "master"),
Map.entry("repositoryUrl", "https://github.com/Azure/azure-rest-api-specs"),
Map.entry("sourceControlAuthProperties", Map.ofEntries(
Map.entry("token", "xxxxx"),
Map.entry("tokenType", "PAT")
)),
Map.entry("sourceControlType", "Github")
)),
Map.entry("sourceTriggerEvents", "commit")
)),
Map.entry("timerTriggers", Map.ofEntries(
Map.entry("name", "myTimerTrigger"),
Map.entry("schedule", "30 9 * * 1-5")
))
))
.build());
}
}
Content copied to clipboard
Tasks_Create_WithUserIdentities_WithSystemIdentity
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var task = new AzureNative.ContainerRegistry.Task("task", new()
{
AgentConfiguration = new AzureNative.ContainerRegistry.Inputs.AgentPropertiesArgs
{
Cpu = 2,
},
Identity = new AzureNative.ContainerRegistry.Inputs.IdentityPropertiesArgs
{
Type = AzureNative.ContainerRegistry.ResourceIdentityType.SystemAssigned,
},
IsSystemTask = false,
Location = "eastus",
Platform = new AzureNative.ContainerRegistry.Inputs.PlatformPropertiesArgs
{
Architecture = "amd64",
Os = "Linux",
},
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Status = "Enabled",
Step = new AzureNative.ContainerRegistry.Inputs.DockerBuildStepArgs
{
Arguments = new[]
{
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = false,
Name = "mytestargument",
Value = "mytestvalue",
},
new AzureNative.ContainerRegistry.Inputs.ArgumentArgs
{
IsSecret = true,
Name = "mysecrettestargument",
Value = "mysecrettestvalue",
},
},
ContextPath = "src",
DockerFilePath = "src/DockerFile",
ImageNames = new[]
{
"azurerest:testtag",
},
IsPushEnabled = true,
NoCache = false,
Type = "Docker",
},
Tags =
{
{ "testkey", "value" },
},
TaskName = "mytTask",
Trigger = new AzureNative.ContainerRegistry.Inputs.TriggerPropertiesArgs
{
BaseImageTrigger = new AzureNative.ContainerRegistry.Inputs.BaseImageTriggerArgs
{
BaseImageTriggerType = "Runtime",
Name = "myBaseImageTrigger",
},
SourceTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.SourceTriggerArgs
{
Name = "mySourceTrigger",
SourceRepository = new AzureNative.ContainerRegistry.Inputs.SourcePropertiesArgs
{
Branch = "master",
RepositoryUrl = "https://github.com/Azure/azure-rest-api-specs",
SourceControlAuthProperties = new AzureNative.ContainerRegistry.Inputs.AuthInfoArgs
{
Token = "xxxxx",
TokenType = "PAT",
},
SourceControlType = "Github",
},
SourceTriggerEvents = new[]
{
"commit",
},
},
},
TimerTriggers = new[]
{
new AzureNative.ContainerRegistry.Inputs.TimerTriggerArgs
{
Name = "myTimerTrigger",
Schedule = "30 9 * * 1-5",
},
},
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewTask(ctx, "task", &containerregistry.TaskArgs{
AgentConfiguration: &containerregistry.AgentPropertiesArgs{
Cpu: pulumi.Int(2),
},
Identity: &containerregistry.IdentityPropertiesArgs{
Type: containerregistry.ResourceIdentityTypeSystemAssigned,
},
IsSystemTask: pulumi.Bool(false),
Location: pulumi.String("eastus"),
Platform: &containerregistry.PlatformPropertiesArgs{
Architecture: pulumi.String("amd64"),
Os: pulumi.String("Linux"),
},
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Status: pulumi.String("Enabled"),
Step: containerregistry.DockerBuildStep{
Arguments: []containerregistry.Argument{
{
IsSecret: false,
Name: "mytestargument",
Value: "mytestvalue",
},
{
IsSecret: true,
Name: "mysecrettestargument",
Value: "mysecrettestvalue",
},
},
ContextPath: "src",
DockerFilePath: "src/DockerFile",
ImageNames: []string{
"azurerest:testtag",
},
IsPushEnabled: true,
NoCache: false,
Type: "Docker",
},
Tags: pulumi.StringMap{
"testkey": pulumi.String("value"),
},
TaskName: pulumi.String("mytTask"),
Trigger: containerregistry.TriggerPropertiesResponse{
BaseImageTrigger: &containerregistry.BaseImageTriggerArgs{
BaseImageTriggerType: pulumi.String("Runtime"),
Name: pulumi.String("myBaseImageTrigger"),
},
SourceTriggers: containerregistry.SourceTriggerArray{
interface{}{
Name: pulumi.String("mySourceTrigger"),
SourceRepository: interface{}{
Branch: pulumi.String("master"),
RepositoryUrl: pulumi.String("https://github.com/Azure/azure-rest-api-specs"),
SourceControlAuthProperties: &containerregistry.AuthInfoArgs{
Token: pulumi.String("xxxxx"),
TokenType: pulumi.String("PAT"),
},
SourceControlType: pulumi.String("Github"),
},
SourceTriggerEvents: pulumi.StringArray{
pulumi.String("commit"),
},
},
},
TimerTriggers: containerregistry.TimerTriggerArray{
&containerregistry.TimerTriggerArgs{
Name: pulumi.String("myTimerTrigger"),
Schedule: pulumi.String("30 9 * * 1-5"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.Task;
import com.pulumi.azurenative.containerregistry.TaskArgs;
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 task = new Task("task", TaskArgs.builder()
.agentConfiguration(Map.of("cpu", 2))
.identity(Map.of("type", "SystemAssigned"))
.isSystemTask(false)
.location("eastus")
.platform(Map.ofEntries(
Map.entry("architecture", "amd64"),
Map.entry("os", "Linux")
))
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.status("Enabled")
.step(Map.ofEntries(
Map.entry("arguments",
Map.ofEntries(
Map.entry("isSecret", false),
Map.entry("name", "mytestargument"),
Map.entry("value", "mytestvalue")
),
Map.ofEntries(
Map.entry("isSecret", true),
Map.entry("name", "mysecrettestargument"),
Map.entry("value", "mysecrettestvalue")
)),
Map.entry("contextPath", "src"),
Map.entry("dockerFilePath", "src/DockerFile"),
Map.entry("imageNames", "azurerest:testtag"),
Map.entry("isPushEnabled", true),
Map.entry("noCache", false),
Map.entry("type", "Docker")
))
.tags(Map.of("testkey", "value"))
.taskName("mytTask")
.trigger(Map.ofEntries(
Map.entry("baseImageTrigger", Map.ofEntries(
Map.entry("baseImageTriggerType", "Runtime"),
Map.entry("name", "myBaseImageTrigger")
)),
Map.entry("sourceTriggers", Map.ofEntries(
Map.entry("name", "mySourceTrigger"),
Map.entry("sourceRepository", Map.ofEntries(
Map.entry("branch", "master"),
Map.entry("repositoryUrl", "https://github.com/Azure/azure-rest-api-specs"),
Map.entry("sourceControlAuthProperties", Map.ofEntries(
Map.entry("token", "xxxxx"),
Map.entry("tokenType", "PAT")
)),
Map.entry("sourceControlType", "Github")
)),
Map.entry("sourceTriggerEvents", "commit")
)),
Map.entry("timerTriggers", Map.ofEntries(
Map.entry("name", "myTimerTrigger"),
Map.entry("schedule", "30 9 * * 1-5")
))
))
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:containerregistry:Task myTask /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}
Content copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard