App

class App : KotlinCustomResource

Manages a Container App.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
name: "acctest-01",
location: example.location,
resourceGroupName: example.name,
sku: "PerGB2018",
retentionInDays: 30,
});
const exampleEnvironment = new azure.containerapp.Environment("example", {
name: "Example-Environment",
location: example.location,
resourceGroupName: example.name,
logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id,
});
const exampleApp = new azure.containerapp.App("example", {
name: "example-app",
containerAppEnvironmentId: exampleEnvironment.id,
resourceGroupName: example.name,
revisionMode: "Single",
template: {
containers: [{
name: "examplecontainerapp",
image: "mcr.microsoft.com/k8se/quickstart:latest",
cpu: 0.25,
memory: "0.5Gi",
}],
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
name="acctest-01",
location=example.location,
resource_group_name=example.name,
sku="PerGB2018",
retention_in_days=30)
example_environment = azure.containerapp.Environment("example",
name="Example-Environment",
location=example.location,
resource_group_name=example.name,
log_analytics_workspace_id=example_analytics_workspace.id)
example_app = azure.containerapp.App("example",
name="example-app",
container_app_environment_id=example_environment.id,
resource_group_name=example.name,
revision_mode="Single",
template={
"containers": [{
"name": "examplecontainerapp",
"image": "mcr.microsoft.com/k8se/quickstart:latest",
"cpu": 0.25,
"memory": "0.5Gi",
}],
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
{
Name = "acctest-01",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "PerGB2018",
RetentionInDays = 30,
});
var exampleEnvironment = new Azure.ContainerApp.Environment("example", new()
{
Name = "Example-Environment",
Location = example.Location,
ResourceGroupName = example.Name,
LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id,
});
var exampleApp = new Azure.ContainerApp.App("example", new()
{
Name = "example-app",
ContainerAppEnvironmentId = exampleEnvironment.Id,
ResourceGroupName = example.Name,
RevisionMode = "Single",
Template = new Azure.ContainerApp.Inputs.AppTemplateArgs
{
Containers = new[]
{
new Azure.ContainerApp.Inputs.AppTemplateContainerArgs
{
Name = "examplecontainerapp",
Image = "mcr.microsoft.com/k8se/quickstart:latest",
Cpu = 0.25,
Memory = "0.5Gi",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/containerapp"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/operationalinsights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
Name: pulumi.String("acctest-01"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("PerGB2018"),
RetentionInDays: pulumi.Int(30),
})
if err != nil {
return err
}
exampleEnvironment, err := containerapp.NewEnvironment(ctx, "example", &containerapp.EnvironmentArgs{
Name: pulumi.String("Example-Environment"),
Location: example.Location,
ResourceGroupName: example.Name,
LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(),
})
if err != nil {
return err
}
_, err = containerapp.NewApp(ctx, "example", &containerapp.AppArgs{
Name: pulumi.String("example-app"),
ContainerAppEnvironmentId: exampleEnvironment.ID(),
ResourceGroupName: example.Name,
RevisionMode: pulumi.String("Single"),
Template: &containerapp.AppTemplateArgs{
Containers: containerapp.AppTemplateContainerArray{
&containerapp.AppTemplateContainerArgs{
Name: pulumi.String("examplecontainerapp"),
Image: pulumi.String("mcr.microsoft.com/k8se/quickstart:latest"),
Cpu: pulumi.Float64(0.25),
Memory: pulumi.String("0.5Gi"),
},
},
},
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
import com.pulumi.azure.containerapp.Environment;
import com.pulumi.azure.containerapp.EnvironmentArgs;
import com.pulumi.azure.containerapp.App;
import com.pulumi.azure.containerapp.AppArgs;
import com.pulumi.azure.containerapp.inputs.AppTemplateArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
.name("acctest-01")
.location(example.location())
.resourceGroupName(example.name())
.sku("PerGB2018")
.retentionInDays(30)
.build());
var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
.name("Example-Environment")
.location(example.location())
.resourceGroupName(example.name())
.logAnalyticsWorkspaceId(exampleAnalyticsWorkspace.id())
.build());
var exampleApp = new App("exampleApp", AppArgs.builder()
.name("example-app")
.containerAppEnvironmentId(exampleEnvironment.id())
.resourceGroupName(example.name())
.revisionMode("Single")
.template(AppTemplateArgs.builder()
.containers(AppTemplateContainerArgs.builder()
.name("examplecontainerapp")
.image("mcr.microsoft.com/k8se/quickstart:latest")
.cpu(0.25)
.memory("0.5Gi")
.build())
.build())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAnalyticsWorkspace:
type: azure:operationalinsights:AnalyticsWorkspace
name: example
properties:
name: acctest-01
location: ${example.location}
resourceGroupName: ${example.name}
sku: PerGB2018
retentionInDays: 30
exampleEnvironment:
type: azure:containerapp:Environment
name: example
properties:
name: Example-Environment
location: ${example.location}
resourceGroupName: ${example.name}
logAnalyticsWorkspaceId: ${exampleAnalyticsWorkspace.id}
exampleApp:
type: azure:containerapp:App
name: example
properties:
name: example-app
containerAppEnvironmentId: ${exampleEnvironment.id}
resourceGroupName: ${example.name}
revisionMode: Single
template:
containers:
- name: examplecontainerapp
image: mcr.microsoft.com/k8se/quickstart:latest
cpu: 0.25
memory: 0.5Gi

Import

A Container App can be imported using the resource id, e.g.

$ pulumi import azure:containerapp/app:App example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/containerApps/myContainerApp"

Properties

Link copied to clipboard

The ID of the Container App Environment within which this Container App should exist. Changing this forces a new resource to be created.

Link copied to clipboard

The ID of the Custom Domain Verification for this Container App.

Link copied to clipboard
val dapr: Output<AppDapr>?

A dapr block as detailed below.

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

An identity block as detailed below.

Link copied to clipboard
val ingress: Output<AppIngress>?

An ingress block as detailed below.

Link copied to clipboard

The FQDN of the Latest Revision of the Container App.

Link copied to clipboard

The name of the latest Container Revision.

Link copied to clipboard
val location: Output<String>

The location this Container App is deployed in. This is the same as the Environment in which it is deployed.

Link copied to clipboard

The maximum of inactive revisions allowed for this Container App.

Link copied to clipboard
val name: Output<String>

The name for this Container App. Changing this forces a new resource to be created.

Link copied to clipboard

A list of the Public IP Addresses which the Container App uses for outbound network access.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val registries: Output<List<AppRegistry>>?

A registry block as detailed below.

Link copied to clipboard

The name of the resource group in which the Container App Environment is to be created. Changing this forces a new resource to be created.

Link copied to clipboard
val revisionMode: Output<String>

The revisions operational mode for the Container App. Possible values include Single and Multiple. In Single mode, a single revision is in operation at any given time. In Multiple mode, more than one revision can be active at a time and can be configured with load distribution via the traffic_weight block in the ingress configuration.

Link copied to clipboard
val secrets: Output<List<AppSecret>>?

One or more secret block as detailed below.

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

A mapping of tags to assign to the Container App.

Link copied to clipboard
val template: Output<AppTemplate>

A template block as detailed below.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The name of the Workload Profile in the Container App Environment to place this Container App.