ContainerApp

class ContainerApp : KotlinCustomResource

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}

Properties

Link copied to clipboard

Non versioned Container App configuration properties.

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

Kind of resource.

Link copied to clipboard

Resource ID of the Container App's KubeEnvironment.

Link copied to clipboard

Fully Qualified Domain Name of the latest revision of the Container App.

Link copied to clipboard

Name of the latest revision of the Container App.

Link copied to clipboard
val location: Output<String>

Resource Location.

Link copied to clipboard
val name: Output<String>

Resource Name.

Link copied to clipboard

Provisioning state of the Container App.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard

Container App versioned application definition.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>