ContainerAppArgs

data class ContainerAppArgs(val configuration: Output<ConfigurationArgs>? = null, val kind: Output<String>? = null, val kubeEnvironmentId: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val template: Output<TemplateArgs>? = null) : ConvertibleToJava<ContainerAppArgs>

Container App. Uses Azure REST API version 2023-01-01. Other available API versions: 2023-12-01.

Example Usage

Create or Update Container App

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var containerApp = new AzureNative.Web.ContainerApp("containerApp", new()
{
Configuration = new AzureNative.Web.Inputs.ConfigurationArgs
{
Ingress = new AzureNative.Web.Inputs.IngressArgs
{
External = true,
TargetPort = 3000,
},
},
Kind = "containerApp",
KubeEnvironmentId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/kubeEnvironments/demokube",
Location = "East US",
Name = "testcontainerApp0",
ResourceGroupName = "rg",
Template = new AzureNative.Web.Inputs.TemplateArgs
{
Containers = new[]
{
new AzureNative.Web.Inputs.ContainerArgs
{
Image = "repo/testcontainerApp0:v1",
Name = "testcontainerApp0",
},
},
Dapr = new AzureNative.Web.Inputs.DaprArgs
{
AppPort = 3000,
Enabled = true,
},
Scale = new AzureNative.Web.Inputs.ScaleArgs
{
MaxReplicas = 5,
MinReplicas = 1,
Rules = new[]
{
new AzureNative.Web.Inputs.ScaleRuleArgs
{
Custom = new AzureNative.Web.Inputs.CustomScaleRuleArgs
{
Metadata =
{
{ "concurrentRequests", "50" },
},
Type = "http",
},
Name = "httpscalingrule",
},
},
},
},
});
});
package main
import (
web "github.com/pulumi/pulumi-azure-native-sdk/web/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := web.NewContainerApp(ctx, "containerApp", &web.ContainerAppArgs{
Configuration: &web.ConfigurationArgs{
Ingress: &web.IngressArgs{
External: pulumi.Bool(true),
TargetPort: pulumi.Int(3000),
},
},
Kind: pulumi.String("containerApp"),
KubeEnvironmentId: pulumi.String("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/kubeEnvironments/demokube"),
Location: pulumi.String("East US"),
Name: pulumi.String("testcontainerApp0"),
ResourceGroupName: pulumi.String("rg"),
Template: &web.TemplateArgs{
Containers: web.ContainerArray{
&web.ContainerArgs{
Image: pulumi.String("repo/testcontainerApp0:v1"),
Name: pulumi.String("testcontainerApp0"),
},
},
Dapr: &web.DaprArgs{
AppPort: pulumi.Int(3000),
Enabled: pulumi.Bool(true),
},
Scale: &web.ScaleArgs{
MaxReplicas: pulumi.Int(5),
MinReplicas: pulumi.Int(1),
Rules: web.ScaleRuleArray{
&web.ScaleRuleArgs{
Custom: &web.CustomScaleRuleArgs{
Metadata: pulumi.StringMap{
"concurrentRequests": pulumi.String("50"),
},
Type: pulumi.String("http"),
},
Name: pulumi.String("httpscalingrule"),
},
},
},
},
})
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.web.ContainerApp;
import com.pulumi.azurenative.web.ContainerAppArgs;
import com.pulumi.azurenative.web.inputs.ConfigurationArgs;
import com.pulumi.azurenative.web.inputs.IngressArgs;
import com.pulumi.azurenative.web.inputs.TemplateArgs;
import com.pulumi.azurenative.web.inputs.DaprArgs;
import com.pulumi.azurenative.web.inputs.ScaleArgs;
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 containerApp = new ContainerApp("containerApp", ContainerAppArgs.builder()
.configuration(ConfigurationArgs.builder()
.ingress(IngressArgs.builder()
.external(true)
.targetPort(3000)
.build())
.build())
.kind("containerApp")
.kubeEnvironmentId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/kubeEnvironments/demokube")
.location("East US")
.name("testcontainerApp0")
.resourceGroupName("rg")
.template(TemplateArgs.builder()
.containers(ContainerArgs.builder()
.image("repo/testcontainerApp0:v1")
.name("testcontainerApp0")
.build())
.dapr(DaprArgs.builder()
.appPort(3000)
.enabled(true)
.build())
.scale(ScaleArgs.builder()
.maxReplicas(5)
.minReplicas(1)
.rules(ScaleRuleArgs.builder()
.custom(CustomScaleRuleArgs.builder()
.metadata(Map.of("concurrentRequests", "50"))
.type("http")
.build())
.name("httpscalingrule")
.build())
.build())
.build())
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:web:ContainerApp testcontainerApp0 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name}

Constructors

Link copied to clipboard
constructor(configuration: Output<ConfigurationArgs>? = null, kind: Output<String>? = null, kubeEnvironmentId: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, template: Output<TemplateArgs>? = null)

Properties

Link copied to clipboard
val configuration: Output<ConfigurationArgs>? = null

Non versioned Container App configuration properties.

Link copied to clipboard
val kind: Output<String>? = null

Kind of resource.

Link copied to clipboard
val kubeEnvironmentId: Output<String>? = null

Resource ID of the Container App's KubeEnvironment.

Link copied to clipboard
val location: Output<String>? = null

Resource Location.

Link copied to clipboard
val name: Output<String>? = null

Name of the Container App.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

Name of the resource group to which the resource belongs.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Resource tags.

Link copied to clipboard
val template: Output<TemplateArgs>? = null

Container App versioned application definition.

Functions

Link copied to clipboard
open override fun toJava(): ContainerAppArgs