Create or update a Container App.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}?api-version=2026-07-01
URI Parameters
| Name |
In |
Required |
Type |
Description |
|
containerAppName
|
path |
True
|
string
|
Name of the Container App.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
The name of the resource group. The name is case insensitive.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
The ID of the target subscription. The value must be an UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
Request Body
| Name |
Required |
Type |
Description |
|
location
|
True
|
string
|
The geo-location where the resource lives
|
|
extendedLocation
|
|
ExtendedLocation
|
The complex type of the extended location.
|
|
identity
|
|
ManagedServiceIdentity
|
managed identities for the Container App to interact with other Azure services without maintaining any secrets or credentials in code.
|
|
kind
|
|
Kind
|
Metadata to represent the container app kind, representing if a container app is workflowapp or functionapp.
|
|
managedBy
|
|
string
|
The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource.
|
|
properties.configuration
|
|
Configuration
|
Non versioned Container App configuration properties.
|
|
properties.environmentId
|
|
string
|
Resource ID of environment.
|
|
properties.managedEnvironmentId
|
|
string
|
Deprecated. Resource ID of the Container App's environment.
|
|
properties.networking
|
|
ContainerAppNetworkingConfiguration
|
Networking configuration for the Container App.
|
|
properties.template
|
|
Template
|
Container App versioned application definition.
|
|
properties.workloadProfileName
|
|
string
|
Workload profile name to pin for container app execution.
|
|
tags
|
|
object
|
Resource tags.
|
Responses
| Name |
Type |
Description |
|
200 OK
|
ContainerApp
|
Resource 'ContainerApp' update operation succeeded
|
|
201 Created
|
ContainerApp
|
Resource 'ContainerApp' create operation succeeded
Headers
- Azure-AsyncOperation: string
- Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
An unexpected error response.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name |
Description |
|
user_impersonation
|
impersonate your user account
|
Examples
Create or Update App On A Connected Environment
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0?api-version=2026-07-01
{
"extendedLocation": {
"name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation",
"type": "CustomLocation"
},
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appPort": 3000,
"appProtocol": "http",
"enableApiLogging": true,
"enabled": true,
"httpMaxRequestSize": 10,
"httpReadBufferSize": 30,
"logLevel": "debug"
},
"ingress": {
"additionalPortMappings": [
{
"external": true,
"targetPort": 1234
},
{
"exposedPort": 3456,
"external": false,
"targetPort": 2345
}
],
"clientCertificateMode": "accept",
"corsPolicy": {
"allowCredentials": true,
"allowedHeaders": [
"HEADER1",
"HEADER2"
],
"allowedMethods": [
"GET",
"POST"
],
"allowedOrigins": [
"https://a.test.com",
"https://b.test.com"
],
"exposeHeaders": [
"HEADER3",
"HEADER4"
],
"maxAge": 1234
},
"customDomains": [
{
"name": "www.my-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"
},
{
"name": "www.my-other-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"
}
],
"external": true,
"ipSecurityRestrictions": [
{
"name": "Allow work IP A subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/32"
},
{
"name": "Allow work IP B subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/8"
}
],
"stickySessions": {
"affinity": "sticky"
},
"targetPort": 3000,
"traffic": [
{
"label": "production",
"revisionName": "testcontainerApp0-ab1234"
}
]
},
"maxInactiveRevisions": 10,
"runtime": {
"java": {
"enableMetrics": true
}
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube",
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v1",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
],
"port": 8080
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
]
}
],
"initContainers": [
{
"name": "testinitcontainerApp0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerApp0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "httpscalingrule",
"custom": {
"type": "http",
"metadata": {
"concurrentRequests": "50"
}
}
}
]
}
}
}
}
import com.azure.resourcemanager.appcontainers.models.Action;
import com.azure.resourcemanager.appcontainers.models.Affinity;
import com.azure.resourcemanager.appcontainers.models.AppProtocol;
import com.azure.resourcemanager.appcontainers.models.BindingType;
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem;
import com.azure.resourcemanager.appcontainers.models.ContainerResources;
import com.azure.resourcemanager.appcontainers.models.CorsPolicy;
import com.azure.resourcemanager.appcontainers.models.CustomDomain;
import com.azure.resourcemanager.appcontainers.models.CustomScaleRule;
import com.azure.resourcemanager.appcontainers.models.Dapr;
import com.azure.resourcemanager.appcontainers.models.ExtendedLocation;
import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes;
import com.azure.resourcemanager.appcontainers.models.Ingress;
import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode;
import com.azure.resourcemanager.appcontainers.models.IngressPortMapping;
import com.azure.resourcemanager.appcontainers.models.IngressStickySessions;
import com.azure.resourcemanager.appcontainers.models.InitContainer;
import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule;
import com.azure.resourcemanager.appcontainers.models.LogLevel;
import com.azure.resourcemanager.appcontainers.models.Runtime;
import com.azure.resourcemanager.appcontainers.models.RuntimeJava;
import com.azure.resourcemanager.appcontainers.models.Scale;
import com.azure.resourcemanager.appcontainers.models.ScaleRule;
import com.azure.resourcemanager.appcontainers.models.Template;
import com.azure.resourcemanager.appcontainers.models.TrafficWeight;
import com.azure.resourcemanager.appcontainers.models.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json
*/
/**
* Sample code: Create or Update App On A Connected Environment.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void createOrUpdateAppOnAConnectedEnvironment(
com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerApp0").withRegion("East US").withExistingResourceGroup("rg")
.withExtendedLocation(new ExtendedLocation().withName(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation")
.withType(ExtendedLocationTypes.CUSTOM_LOCATION))
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube")
.withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000)
.withTraffic(Arrays
.asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234").withLabel("production")))
.withCustomDomains(Arrays.asList(new CustomDomain().withName("www.my-name.com")
.withBindingType(BindingType.SNI_ENABLED).withCertificateId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
new CustomDomain().withName("www.my-other-name.com").withBindingType(BindingType.SNI_ENABLED)
.withCertificateId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))
.withIpSecurityRestrictions(Arrays.asList(
new IpSecurityRestrictionRule().withName("Allow work IP A subnet")
.withDescription("Allowing all IP's within the subnet below to access containerapp")
.withIpAddressRange("192.168.1.1/32").withAction(Action.ALLOW),
new IpSecurityRestrictionRule().withName("Allow work IP B subnet")
.withDescription("Allowing all IP's within the subnet below to access containerapp")
.withIpAddressRange("192.168.1.1/8").withAction(Action.ALLOW)))
.withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))
.withClientCertificateMode(IngressClientCertificateMode.ACCEPT)
.withCorsPolicy(new CorsPolicy()
.withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com"))
.withAllowedMethods(Arrays.asList("GET", "POST"))
.withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2"))
.withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")).withMaxAge(1234).withAllowCredentials(true))
.withAdditionalPortMappings(
Arrays.asList(new IngressPortMapping().withExternal(true).withTargetPort(1234),
new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456))))
.withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000)
.withHttpReadBufferSize(30).withHttpMaxRequestSize(10).withLogLevel(LogLevel.DEBUG)
.withEnableApiLogging(true))
.withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true)))
.withMaxInactiveRevisions(10))
.withTemplate(new Template()
.withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4")
.withName("testinitcontainerApp0").withCommand(Arrays.asList("/bin/sh"))
.withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done"))
.withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi"))))
.withContainers(
Arrays
.asList(new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0")
.withProbes(Arrays.asList(new ContainerAppProbe()
.withHttpGet(new ContainerAppProbeHttpGet()
.withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem()
.withName("Custom-Header").withValue("Awesome")))
.withPath("/health").withPort(8080))
.withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS)))))
.withScale(
new Scale().withMinReplicas(1).withMaxReplicas(5).withCooldownPeriod(350).withPollingInterval(35)
.withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule").withCustom(
new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50")))))))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_create_or_update_connected_environment.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerApp0",
container_app_envelope={
"extendedLocation": {
"name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation",
"type": "CustomLocation",
},
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appPort": 3000,
"appProtocol": "http",
"enableApiLogging": True,
"enabled": True,
"httpMaxRequestSize": 10,
"httpReadBufferSize": 30,
"logLevel": "debug",
},
"ingress": {
"additionalPortMappings": [
{"external": True, "targetPort": 1234},
{"exposedPort": 3456, "external": False, "targetPort": 2345},
],
"clientCertificateMode": "accept",
"corsPolicy": {
"allowCredentials": True,
"allowedHeaders": ["HEADER1", "HEADER2"],
"allowedMethods": ["GET", "POST"],
"allowedOrigins": ["https://a.test.com", "https://b.test.com"],
"exposeHeaders": ["HEADER3", "HEADER4"],
"maxAge": 1234,
},
"customDomains": [
{
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com",
"name": "www.my-name.com",
},
{
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com",
"name": "www.my-other-name.com",
},
],
"external": True,
"ipSecurityRestrictions": [
{
"action": "Allow",
"description": "Allowing all IP's within the subnet below to access containerapp",
"ipAddressRange": "192.168.1.1/32",
"name": "Allow work IP A subnet",
},
{
"action": "Allow",
"description": "Allowing all IP's within the subnet below to access containerapp",
"ipAddressRange": "192.168.1.1/8",
"name": "Allow work IP B subnet",
},
],
"stickySessions": {"affinity": "sticky"},
"targetPort": 3000,
"traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234"}],
},
"maxInactiveRevisions": 10,
"runtime": {"java": {"enableMetrics": True}},
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube",
"template": {
"containers": [
{
"image": "repo/testcontainerApp0:v1",
"name": "testcontainerApp0",
"probes": [
{
"httpGet": {
"httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}],
"path": "/health",
"port": 8080,
},
"initialDelaySeconds": 3,
"periodSeconds": 3,
"type": "Liveness",
}
],
}
],
"initContainers": [
{
"args": ["-c", "while true; do echo hello; sleep 10;done"],
"command": ["/bin/sh"],
"image": "repo/testcontainerApp0:v4",
"name": "testinitcontainerApp0",
"resources": {"cpu": 0.2, "memory": "100Mi"},
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"},
"name": "httpscalingrule",
}
],
},
},
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateAppOnAConnectedEnvironment() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerApp0", armappcontainers.ContainerApp{
ExtendedLocation: &armappcontainers.ExtendedLocation{
Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"),
Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation),
},
Location: to.Ptr("East US"),
Properties: &armappcontainers.ContainerAppProperties{
Configuration: &armappcontainers.Configuration{
Dapr: &armappcontainers.Dapr{
AppPort: to.Ptr[int32](3000),
AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP),
EnableAPILogging: to.Ptr(true),
Enabled: to.Ptr(true),
HTTPMaxRequestSize: to.Ptr[int32](10),
HTTPReadBufferSize: to.Ptr[int32](30),
LogLevel: to.Ptr(armappcontainers.LogLevelDebug),
},
Ingress: &armappcontainers.Ingress{
AdditionalPortMappings: []*armappcontainers.IngressPortMapping{
{
External: to.Ptr(true),
TargetPort: to.Ptr[int32](1234),
},
{
ExposedPort: to.Ptr[int32](3456),
External: to.Ptr(false),
TargetPort: to.Ptr[int32](2345),
},
},
ClientCertificateMode: to.Ptr(armappcontainers.IngressClientCertificateModeAccept),
CorsPolicy: &armappcontainers.CorsPolicy{
AllowCredentials: to.Ptr(true),
AllowedHeaders: []*string{
to.Ptr("HEADER1"),
to.Ptr("HEADER2"),
},
AllowedMethods: []*string{
to.Ptr("GET"),
to.Ptr("POST"),
},
AllowedOrigins: []*string{
to.Ptr("https://a.test.com"),
to.Ptr("https://b.test.com"),
},
ExposeHeaders: []*string{
to.Ptr("HEADER3"),
to.Ptr("HEADER4"),
},
MaxAge: to.Ptr[int32](1234),
},
CustomDomains: []*armappcontainers.CustomDomain{
{
Name: to.Ptr("www.my-name.com"),
BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
},
{
Name: to.Ptr("www.my-other-name.com"),
BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"),
},
},
External: to.Ptr(true),
IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{
{
Name: to.Ptr("Allow work IP A subnet"),
Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
Action: to.Ptr(armappcontainers.ActionAllow),
IPAddressRange: to.Ptr("192.168.1.1/32"),
},
{
Name: to.Ptr("Allow work IP B subnet"),
Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
Action: to.Ptr(armappcontainers.ActionAllow),
IPAddressRange: to.Ptr("192.168.1.1/8"),
},
},
StickySessions: &armappcontainers.IngressStickySessions{
Affinity: to.Ptr(armappcontainers.AffinitySticky),
},
TargetPort: to.Ptr[int32](3000),
Traffic: []*armappcontainers.TrafficWeight{
{
Label: to.Ptr("production"),
RevisionName: to.Ptr("testcontainerApp0-ab1234"),
},
},
},
MaxInactiveRevisions: to.Ptr[int32](10),
Runtime: &armappcontainers.Runtime{
Java: &armappcontainers.RuntimeJava{
EnableMetrics: to.Ptr(true),
},
},
},
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"),
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("testcontainerApp0"),
Image: to.Ptr("repo/testcontainerApp0:v1"),
Probes: []*armappcontainers.ContainerAppProbe{
{
Type: to.Ptr(armappcontainers.TypeLiveness),
HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{
Path: to.Ptr("/health"),
HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{
{
Name: to.Ptr("Custom-Header"),
Value: to.Ptr("Awesome"),
},
},
Port: to.Ptr[int32](8080),
},
InitialDelaySeconds: to.Ptr[int32](3),
PeriodSeconds: to.Ptr[int32](3),
},
},
},
},
InitContainers: []*armappcontainers.InitContainer{
{
Name: to.Ptr("testinitcontainerApp0"),
Args: []*string{
to.Ptr("-c"),
to.Ptr("while true; do echo hello; sleep 10;done"),
},
Command: []*string{
to.Ptr("/bin/sh"),
},
Image: to.Ptr("repo/testcontainerApp0:v4"),
Resources: &armappcontainers.ContainerResources{
CPU: to.Ptr[float64](0.2),
Memory: to.Ptr("100Mi"),
},
},
},
Scale: &armappcontainers.Scale{
CooldownPeriod: to.Ptr[int32](350),
MaxReplicas: to.Ptr[int32](5),
MinReplicas: to.Ptr[int32](1),
PollingInterval: to.Ptr[int32](35),
Rules: []*armappcontainers.ScaleRule{
{
Name: to.Ptr("httpscalingrule"),
Custom: &armappcontainers.CustomScaleRule{
Type: to.Ptr("http"),
Metadata: map[string]*string{
"concurrentRequests": to.Ptr("50"),
},
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerApp0"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ExtendedLocation: &armappcontainers.ExtendedLocation{
// Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"),
// Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation),
// },
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"),
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ContainerAppProperties{
// Configuration: &armappcontainers.Configuration{
// Dapr: &armappcontainers.Dapr{
// AppPort: to.Ptr[int32](3000),
// AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP),
// Enabled: to.Ptr(true),
// HTTPReadBufferSize: to.Ptr[int32](30),
// },
// Ingress: &armappcontainers.Ingress{
// CustomDomains: []*armappcontainers.CustomDomain{
// {
// Name: to.Ptr("www.my-name.com"),
// BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
// CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
// },
// {
// Name: to.Ptr("www.my-other-name.com"),
// BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
// CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"),
// },
// },
// External: to.Ptr(true),
// Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{
// {
// Name: to.Ptr("Allow work IP A subnet"),
// Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
// Action: to.Ptr(armappcontainers.ActionAllow),
// IPAddressRange: to.Ptr("192.168.1.1/32"),
// },
// {
// Name: to.Ptr("Allow work IP B subnet"),
// Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
// Action: to.Ptr(armappcontainers.ActionAllow),
// IPAddressRange: to.Ptr("192.168.1.1/8"),
// },
// },
// StickySessions: &armappcontainers.IngressStickySessions{
// Affinity: to.Ptr(armappcontainers.AffinitySticky),
// },
// TargetPort: to.Ptr[int32](3000),
// Traffic: []*armappcontainers.TrafficWeight{
// {
// RevisionName: to.Ptr("testcontainerApp0-ab1234"),
// },
// {
// Label: to.Ptr("staging"),
// RevisionName: to.Ptr("testcontainerApp0-ab4321"),
// },
// },
// Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto),
// },
// Runtime: &armappcontainers.Runtime{
// Java: &armappcontainers.RuntimeJava{
// EnableMetrics: to.Ptr(true),
// },
// },
// },
// EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"),
// EventStreamEndpoint: to.Ptr("testEndpoint"),
// LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"),
// LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// RunningStatus: to.Ptr(armappcontainers.ContainerAppRunningStatusRunning),
// Template: &armappcontainers.Template{
// Containers: []*armappcontainers.Container{
// {
// Name: to.Ptr("testcontainerApp0"),
// Image: to.Ptr("repo/testcontainerApp0:v4"),
// Probes: []*armappcontainers.ContainerAppProbe{
// {
// Type: to.Ptr(armappcontainers.TypeLiveness),
// HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{
// Path: to.Ptr("/health"),
// HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{
// {
// Name: to.Ptr("Custom-Header"),
// Value: to.Ptr("Awesome"),
// },
// },
// Port: to.Ptr[int32](8080),
// },
// InitialDelaySeconds: to.Ptr[int32](3),
// PeriodSeconds: to.Ptr[int32](3),
// },
// },
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.2),
// Memory: to.Ptr("100Mi"),
// },
// },
// },
// InitContainers: []*armappcontainers.InitContainer{
// {
// Name: to.Ptr("testinitcontainerApp0"),
// Args: []*string{
// to.Ptr("-c"),
// to.Ptr("while true; do echo hello; sleep 10;done"),
// },
// Command: []*string{
// to.Ptr("/bin/sh"),
// },
// Image: to.Ptr("repo/testcontainerApp0:v4"),
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.2),
// Memory: to.Ptr("100Mi"),
// },
// },
// },
// Scale: &armappcontainers.Scale{
// CooldownPeriod: to.Ptr[int32](350),
// MaxReplicas: to.Ptr[int32](5),
// MinReplicas: to.Ptr[int32](1),
// PollingInterval: to.Ptr[int32](35),
// Rules: []*armappcontainers.ScaleRule{
// {
// Name: to.Ptr("httpscalingrule"),
// HTTP: &armappcontainers.HTTPScaleRule{
// Metadata: map[string]*string{
// "concurrentRequests": to.Ptr("50"),
// },
// },
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json
*/
async function createOrUpdateAppOnAConnectedEnvironment() {
const credential = new DefaultAzureCredential();
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerApp0", {
extendedLocation: {
name: "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation",
type: "CustomLocation",
},
location: "East US",
configuration: {
dapr: {
appPort: 3000,
appProtocol: "http",
enableApiLogging: true,
enabled: true,
httpMaxRequestSize: 10,
httpReadBufferSize: 30,
logLevel: "debug",
},
ingress: {
additionalPortMappings: [
{ external: true, targetPort: 1234 },
{ exposedPort: 3456, external: false, targetPort: 2345 },
],
clientCertificateMode: "accept",
corsPolicy: {
allowCredentials: true,
allowedHeaders: ["HEADER1", "HEADER2"],
allowedMethods: ["GET", "POST"],
allowedOrigins: ["https://a.test.com", "https://b.test.com"],
exposeHeaders: ["HEADER3", "HEADER4"],
maxAge: 1234,
},
customDomains: [
{
name: "www.my-name.com",
bindingType: "SniEnabled",
certificateId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com",
},
{
name: "www.my-other-name.com",
bindingType: "SniEnabled",
certificateId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com",
},
],
external: true,
ipSecurityRestrictions: [
{
name: "Allow work IP A subnet",
description: "Allowing all IP's within the subnet below to access containerapp",
action: "Allow",
ipAddressRange: "192.168.1.1/32",
},
{
name: "Allow work IP B subnet",
description: "Allowing all IP's within the subnet below to access containerapp",
action: "Allow",
ipAddressRange: "192.168.1.1/8",
},
],
stickySessions: { affinity: "sticky" },
targetPort: 3000,
traffic: [{ label: "production", revisionName: "testcontainerApp0-ab1234" }],
},
maxInactiveRevisions: 10,
runtime: { java: { enableMetrics: true } },
},
environmentId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube",
template: {
containers: [
{
name: "testcontainerApp0",
image: "repo/testcontainerApp0:v1",
probes: [
{
type: "Liveness",
httpGet: {
path: "/health",
httpHeaders: [{ name: "Custom-Header", value: "Awesome" }],
port: 8080,
},
initialDelaySeconds: 3,
periodSeconds: 3,
},
],
},
],
initContainers: [
{
name: "testinitcontainerApp0",
args: ["-c", "while true; do echo hello; sleep 10;done"],
command: ["/bin/sh"],
image: "repo/testcontainerApp0:v4",
resources: { cpu: 0.2, memory: "100Mi" },
},
],
scale: {
cooldownPeriod: 350,
maxReplicas: 5,
minReplicas: 1,
pollingInterval: 35,
rules: [
{
name: "httpscalingrule",
custom: { type: "http", metadata: { concurrentRequests: "50" } },
},
],
},
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerApp0",
"type": "Microsoft.App/containerApps",
"extendedLocation": {
"name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation",
"type": "CustomLocation"
},
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0",
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appPort": 3000,
"appProtocol": "http",
"enabled": true,
"httpReadBufferSize": 30
},
"ingress": {
"customDomains": [
{
"name": "www.my-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"
},
{
"name": "www.my-other-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"
}
],
"external": true,
"fqdn": "testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"ipSecurityRestrictions": [
{
"name": "Allow work IP A subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/32"
},
{
"name": "Allow work IP B subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/8"
}
],
"stickySessions": {
"affinity": "sticky"
},
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerApp0-ab1234"
},
{
"label": "staging",
"revisionName": "testcontainerApp0-ab4321"
}
],
"transport": "auto"
},
"runtime": {
"java": {
"enableMetrics": true
}
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube",
"eventStreamEndpoint": "testEndpoint",
"latestReadyRevisionName": "testcontainerApp0-pjxhsye",
"latestRevisionFqdn": "testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"provisioningState": "Succeeded",
"runningStatus": "Running",
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v4",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
],
"port": 8080
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"initContainers": [
{
"name": "testinitcontainerApp0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerApp0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "httpscalingrule",
"http": {
"metadata": {
"concurrentRequests": "50"
}
}
}
]
}
}
}
}
{
"name": "testcontainerApp0",
"type": "Microsoft.App/containerApps",
"extendedLocation": {
"name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation",
"type": "CustomLocation"
},
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0",
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appPort": 3000,
"appProtocol": "http",
"enabled": true,
"httpReadBufferSize": 30
},
"ingress": {
"external": true,
"fqdn": "testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerApp0-ab1234"
},
{
"label": "staging",
"revisionName": "testcontainerApp0-ab4321"
}
],
"transport": "auto"
},
"runtime": {
"java": {
"enableMetrics": true
}
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube",
"eventStreamEndpoint": "testEndpoint",
"latestRevisionFqdn": "testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"provisioningState": "InProgress",
"runningStatus": "Progressing",
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v4",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
],
"port": 8080
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"initContainers": [
{
"name": "testinitcontainerApp0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerApp0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "httpscalingrule",
"http": {
"metadata": {
"concurrentRequests": "50"
}
}
}
]
}
}
}
}
Create or Update Container App
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0?api-version=2026-07-01
{
"identity": {
"type": "SystemAssigned,UserAssigned",
"userAssignedIdentities": {
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}
}
},
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appHealth": {
"path": "/health",
"enabled": true,
"probeIntervalSeconds": 3,
"probeTimeoutMilliseconds": 1000,
"threshold": 3
},
"appPort": 3000,
"appProtocol": "http",
"enableApiLogging": true,
"enabled": true,
"httpMaxRequestSize": 10,
"httpReadBufferSize": 30,
"logLevel": "debug",
"maxConcurrency": 10
},
"identitySettings": [
{
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"lifecycle": "All"
},
{
"identity": "system",
"lifecycle": "Init"
}
],
"ingress": {
"additionalPortMappings": [
{
"external": true,
"targetPort": 1234
},
{
"exposedPort": 3456,
"external": false,
"targetPort": 2345
}
],
"clientCertificateMode": "accept",
"corsPolicy": {
"allowCredentials": true,
"allowedHeaders": [
"HEADER1",
"HEADER2"
],
"allowedMethods": [
"GET",
"POST"
],
"allowedOrigins": [
"https://a.test.com",
"https://b.test.com"
],
"exposeHeaders": [
"HEADER3",
"HEADER4"
],
"maxAge": 1234
},
"customDomains": [
{
"name": "www.my-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"
},
{
"name": "www.my-other-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"
}
],
"external": true,
"ipSecurityRestrictions": [
{
"name": "Allow work IP A subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/32"
},
{
"name": "Allow work IP B subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/8"
}
],
"stickySessions": {
"affinity": "sticky"
},
"targetPort": 3000,
"traffic": [
{
"label": "production",
"revisionName": "testcontainerApp0-ab1234"
}
]
},
"maxInactiveRevisions": 10,
"runtime": {
"java": {
"enableMetrics": true
}
},
"service": {
"type": "redis"
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v1",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
],
"port": 8080
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
],
"volumeMounts": [
{
"mountPath": "/mnt/path1",
"subPath": "subPath1",
"volumeName": "azurefile"
},
{
"mountPath": "/mnt/path2",
"subPath": "subPath2",
"volumeName": "nfsazurefile"
}
]
}
],
"initContainers": [
{
"name": "testinitcontainerApp0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerApp0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "httpscalingrule",
"custom": {
"type": "http",
"metadata": {
"concurrentRequests": "50"
}
}
},
{
"name": "servicebus",
"custom": {
"type": "azure-servicebus",
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"metadata": {
"messageCount": "5",
"namespace": "mynamespace",
"queueName": "myqueue"
}
}
},
{
"name": "azure-queue",
"azureQueue": {
"accountName": "account1",
"identity": "system",
"queueLength": 1,
"queueName": "queue1"
}
}
]
},
"serviceBinds": [
{
"name": "redisService",
"serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService"
}
],
"volumes": [
{
"name": "azurefile",
"storageName": "storage",
"storageType": "AzureFile"
},
{
"name": "nfsazurefile",
"storageName": "nfsStorage",
"storageType": "NfsAzureFile"
}
]
},
"workloadProfileName": "My-GP-01"
}
}
import com.azure.resourcemanager.appcontainers.models.Action;
import com.azure.resourcemanager.appcontainers.models.Affinity;
import com.azure.resourcemanager.appcontainers.models.AppProtocol;
import com.azure.resourcemanager.appcontainers.models.BindingType;
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem;
import com.azure.resourcemanager.appcontainers.models.ContainerResources;
import com.azure.resourcemanager.appcontainers.models.CorsPolicy;
import com.azure.resourcemanager.appcontainers.models.CustomDomain;
import com.azure.resourcemanager.appcontainers.models.CustomScaleRule;
import com.azure.resourcemanager.appcontainers.models.Dapr;
import com.azure.resourcemanager.appcontainers.models.DaprAppHealth;
import com.azure.resourcemanager.appcontainers.models.IdentitySettings;
import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle;
import com.azure.resourcemanager.appcontainers.models.Ingress;
import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode;
import com.azure.resourcemanager.appcontainers.models.IngressPortMapping;
import com.azure.resourcemanager.appcontainers.models.IngressStickySessions;
import com.azure.resourcemanager.appcontainers.models.InitContainer;
import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule;
import com.azure.resourcemanager.appcontainers.models.LogLevel;
import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity;
import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.appcontainers.models.QueueScaleRule;
import com.azure.resourcemanager.appcontainers.models.Runtime;
import com.azure.resourcemanager.appcontainers.models.RuntimeJava;
import com.azure.resourcemanager.appcontainers.models.Scale;
import com.azure.resourcemanager.appcontainers.models.ScaleRule;
import com.azure.resourcemanager.appcontainers.models.Service;
import com.azure.resourcemanager.appcontainers.models.ServiceBind;
import com.azure.resourcemanager.appcontainers.models.StorageType;
import com.azure.resourcemanager.appcontainers.models.Template;
import com.azure.resourcemanager.appcontainers.models.TrafficWeight;
import com.azure.resourcemanager.appcontainers.models.Type;
import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity;
import com.azure.resourcemanager.appcontainers.models.Volume;
import com.azure.resourcemanager.appcontainers.models.VolumeMount;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update Container App.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void
createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerApp0").withRegion("East US").withExistingResourceGroup("rg")
.withIdentity(new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
new UserAssignedIdentity())))
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.withWorkloadProfileName("My-GP-01")
.withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000)
.withTraffic(Arrays
.asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234").withLabel("production")))
.withCustomDomains(Arrays.asList(new CustomDomain().withName("www.my-name.com")
.withBindingType(BindingType.SNI_ENABLED).withCertificateId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
new CustomDomain().withName("www.my-other-name.com").withBindingType(BindingType.SNI_ENABLED)
.withCertificateId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))
.withIpSecurityRestrictions(Arrays.asList(
new IpSecurityRestrictionRule().withName("Allow work IP A subnet")
.withDescription("Allowing all IP's within the subnet below to access containerapp")
.withIpAddressRange("192.168.1.1/32").withAction(Action.ALLOW),
new IpSecurityRestrictionRule().withName("Allow work IP B subnet")
.withDescription("Allowing all IP's within the subnet below to access containerapp")
.withIpAddressRange("192.168.1.1/8").withAction(Action.ALLOW)))
.withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))
.withClientCertificateMode(IngressClientCertificateMode.ACCEPT)
.withCorsPolicy(new CorsPolicy()
.withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com"))
.withAllowedMethods(Arrays.asList("GET", "POST"))
.withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2"))
.withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")).withMaxAge(1234).withAllowCredentials(true))
.withAdditionalPortMappings(
Arrays.asList(new IngressPortMapping().withExternal(true).withTargetPort(1234),
new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456))))
.withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000)
.withHttpReadBufferSize(30).withHttpMaxRequestSize(10).withLogLevel(LogLevel.DEBUG)
.withEnableApiLogging(true)
.withAppHealth(new DaprAppHealth().withEnabled(true).withPath("/health").withProbeIntervalSeconds(3)
.withProbeTimeoutMilliseconds(1000).withThreshold(3))
.withMaxConcurrency(10))
.withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true)))
.withMaxInactiveRevisions(10).withService(new Service().withType("redis"))
.withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")
.withLifecycle(IdentitySettingsLifeCycle.ALL),
new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT))))
.withTemplate(new Template()
.withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4")
.withName("testinitcontainerApp0").withCommand(Arrays.asList("/bin/sh"))
.withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done"))
.withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi"))))
.withContainers(
Arrays.asList(new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0")
.withVolumeMounts(Arrays.asList(
new VolumeMount().withVolumeName("azurefile").withMountPath("/mnt/path1")
.withSubPath("subPath1"),
new VolumeMount().withVolumeName("nfsazurefile").withMountPath("/mnt/path2")
.withSubPath("subPath2")))
.withProbes(Arrays.asList(new ContainerAppProbe()
.withHttpGet(new ContainerAppProbeHttpGet()
.withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem()
.withName("Custom-Header").withValue("Awesome")))
.withPath("/health").withPort(8080))
.withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS)))))
.withScale(new Scale().withMinReplicas(1).withMaxReplicas(5).withCooldownPeriod(350)
.withPollingInterval(35)
.withRules(Arrays.asList(
new ScaleRule().withName("httpscalingrule").withCustom(
new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50"))),
new ScaleRule().withName("servicebus").withCustom(new CustomScaleRule()
.withType("azure-servicebus")
.withMetadata(
mapOf("messageCount", "5", "namespace", "mynamespace", "queueName", "myqueue"))
.withIdentity(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")),
new ScaleRule().withName("azure-queue")
.withAzureQueue(new QueueScaleRule().withAccountName("account1").withQueueName("queue1")
.withQueueLength(1).withIdentity("system")))))
.withVolumes(Arrays.asList(
new Volume().withName("azurefile").withStorageType(StorageType.AZURE_FILE)
.withStorageName("storage"),
new Volume().withName("nfsazurefile").withStorageType(StorageType.NFS_AZURE_FILE)
.withStorageName("nfsStorage")))
.withServiceBinds(Arrays.asList(new ServiceBind().withServiceId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService")
.withName("redisService"))))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_create_or_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerApp0",
container_app_envelope={
"identity": {
"type": "SystemAssigned,UserAssigned",
"userAssignedIdentities": {
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}
},
},
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appHealth": {
"enabled": True,
"path": "/health",
"probeIntervalSeconds": 3,
"probeTimeoutMilliseconds": 1000,
"threshold": 3,
},
"appPort": 3000,
"appProtocol": "http",
"enableApiLogging": True,
"enabled": True,
"httpMaxRequestSize": 10,
"httpReadBufferSize": 30,
"logLevel": "debug",
"maxConcurrency": 10,
},
"identitySettings": [
{
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"lifecycle": "All",
},
{"identity": "system", "lifecycle": "Init"},
],
"ingress": {
"additionalPortMappings": [
{"external": True, "targetPort": 1234},
{"exposedPort": 3456, "external": False, "targetPort": 2345},
],
"clientCertificateMode": "accept",
"corsPolicy": {
"allowCredentials": True,
"allowedHeaders": ["HEADER1", "HEADER2"],
"allowedMethods": ["GET", "POST"],
"allowedOrigins": ["https://a.test.com", "https://b.test.com"],
"exposeHeaders": ["HEADER3", "HEADER4"],
"maxAge": 1234,
},
"customDomains": [
{
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com",
"name": "www.my-name.com",
},
{
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com",
"name": "www.my-other-name.com",
},
],
"external": True,
"ipSecurityRestrictions": [
{
"action": "Allow",
"description": "Allowing all IP's within the subnet below to access containerapp",
"ipAddressRange": "192.168.1.1/32",
"name": "Allow work IP A subnet",
},
{
"action": "Allow",
"description": "Allowing all IP's within the subnet below to access containerapp",
"ipAddressRange": "192.168.1.1/8",
"name": "Allow work IP B subnet",
},
],
"stickySessions": {"affinity": "sticky"},
"targetPort": 3000,
"traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234"}],
},
"maxInactiveRevisions": 10,
"runtime": {"java": {"enableMetrics": True}},
"service": {"type": "redis"},
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"template": {
"containers": [
{
"image": "repo/testcontainerApp0:v1",
"name": "testcontainerApp0",
"probes": [
{
"httpGet": {
"httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}],
"path": "/health",
"port": 8080,
},
"initialDelaySeconds": 3,
"periodSeconds": 3,
"type": "Liveness",
}
],
"volumeMounts": [
{"mountPath": "/mnt/path1", "subPath": "subPath1", "volumeName": "azurefile"},
{"mountPath": "/mnt/path2", "subPath": "subPath2", "volumeName": "nfsazurefile"},
],
}
],
"initContainers": [
{
"args": ["-c", "while true; do echo hello; sleep 10;done"],
"command": ["/bin/sh"],
"image": "repo/testcontainerApp0:v4",
"name": "testinitcontainerApp0",
"resources": {"cpu": 0.2, "memory": "100Mi"},
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"},
"name": "httpscalingrule",
},
{
"custom": {
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"metadata": {
"messageCount": "5",
"namespace": "mynamespace",
"queueName": "myqueue",
},
"type": "azure-servicebus",
},
"name": "servicebus",
},
{
"azureQueue": {
"accountName": "account1",
"identity": "system",
"queueLength": 1,
"queueName": "queue1",
},
"name": "azure-queue",
},
],
},
"serviceBinds": [
{
"name": "redisService",
"serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService",
}
],
"volumes": [
{"name": "azurefile", "storageName": "storage", "storageType": "AzureFile"},
{"name": "nfsazurefile", "storageName": "nfsStorage", "storageType": "NfsAzureFile"},
],
},
"workloadProfileName": "My-GP-01",
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_CreateOrUpdate.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateContainerApp() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerApp0", armappcontainers.ContainerApp{
Identity: &armappcontainers.ManagedServiceIdentity{
Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {},
},
},
Location: to.Ptr("East US"),
Properties: &armappcontainers.ContainerAppProperties{
Configuration: &armappcontainers.Configuration{
Dapr: &armappcontainers.Dapr{
AppHealth: &armappcontainers.DaprAppHealth{
Path: to.Ptr("/health"),
Enabled: to.Ptr(true),
ProbeIntervalSeconds: to.Ptr[int32](3),
ProbeTimeoutMilliseconds: to.Ptr[int32](1000),
Threshold: to.Ptr[int32](3),
},
AppPort: to.Ptr[int32](3000),
AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP),
EnableAPILogging: to.Ptr(true),
Enabled: to.Ptr(true),
HTTPMaxRequestSize: to.Ptr[int32](10),
HTTPReadBufferSize: to.Ptr[int32](30),
LogLevel: to.Ptr(armappcontainers.LogLevelDebug),
MaxConcurrency: to.Ptr[int32](10),
},
IdentitySettings: []*armappcontainers.IdentitySettings{
{
Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"),
Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll),
},
{
Identity: to.Ptr("system"),
Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit),
},
},
Ingress: &armappcontainers.Ingress{
AdditionalPortMappings: []*armappcontainers.IngressPortMapping{
{
External: to.Ptr(true),
TargetPort: to.Ptr[int32](1234),
},
{
ExposedPort: to.Ptr[int32](3456),
External: to.Ptr(false),
TargetPort: to.Ptr[int32](2345),
},
},
ClientCertificateMode: to.Ptr(armappcontainers.IngressClientCertificateModeAccept),
CorsPolicy: &armappcontainers.CorsPolicy{
AllowCredentials: to.Ptr(true),
AllowedHeaders: []*string{
to.Ptr("HEADER1"),
to.Ptr("HEADER2"),
},
AllowedMethods: []*string{
to.Ptr("GET"),
to.Ptr("POST"),
},
AllowedOrigins: []*string{
to.Ptr("https://a.test.com"),
to.Ptr("https://b.test.com"),
},
ExposeHeaders: []*string{
to.Ptr("HEADER3"),
to.Ptr("HEADER4"),
},
MaxAge: to.Ptr[int32](1234),
},
CustomDomains: []*armappcontainers.CustomDomain{
{
Name: to.Ptr("www.my-name.com"),
BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
},
{
Name: to.Ptr("www.my-other-name.com"),
BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"),
},
},
External: to.Ptr(true),
IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{
{
Name: to.Ptr("Allow work IP A subnet"),
Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
Action: to.Ptr(armappcontainers.ActionAllow),
IPAddressRange: to.Ptr("192.168.1.1/32"),
},
{
Name: to.Ptr("Allow work IP B subnet"),
Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
Action: to.Ptr(armappcontainers.ActionAllow),
IPAddressRange: to.Ptr("192.168.1.1/8"),
},
},
StickySessions: &armappcontainers.IngressStickySessions{
Affinity: to.Ptr(armappcontainers.AffinitySticky),
},
TargetPort: to.Ptr[int32](3000),
Traffic: []*armappcontainers.TrafficWeight{
{
Label: to.Ptr("production"),
RevisionName: to.Ptr("testcontainerApp0-ab1234"),
},
},
},
MaxInactiveRevisions: to.Ptr[int32](10),
Runtime: &armappcontainers.Runtime{
Java: &armappcontainers.RuntimeJava{
EnableMetrics: to.Ptr(true),
},
},
Service: &armappcontainers.Service{
Type: to.Ptr("redis"),
},
},
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("testcontainerApp0"),
Image: to.Ptr("repo/testcontainerApp0:v1"),
Probes: []*armappcontainers.ContainerAppProbe{
{
Type: to.Ptr(armappcontainers.TypeLiveness),
HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{
Path: to.Ptr("/health"),
HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{
{
Name: to.Ptr("Custom-Header"),
Value: to.Ptr("Awesome"),
},
},
Port: to.Ptr[int32](8080),
},
InitialDelaySeconds: to.Ptr[int32](3),
PeriodSeconds: to.Ptr[int32](3),
},
},
VolumeMounts: []*armappcontainers.VolumeMount{
{
MountPath: to.Ptr("/mnt/path1"),
SubPath: to.Ptr("subPath1"),
VolumeName: to.Ptr("azurefile"),
},
{
MountPath: to.Ptr("/mnt/path2"),
SubPath: to.Ptr("subPath2"),
VolumeName: to.Ptr("nfsazurefile"),
},
},
},
},
InitContainers: []*armappcontainers.InitContainer{
{
Name: to.Ptr("testinitcontainerApp0"),
Args: []*string{
to.Ptr("-c"),
to.Ptr("while true; do echo hello; sleep 10;done"),
},
Command: []*string{
to.Ptr("/bin/sh"),
},
Image: to.Ptr("repo/testcontainerApp0:v4"),
Resources: &armappcontainers.ContainerResources{
CPU: to.Ptr[float64](0.2),
Memory: to.Ptr("100Mi"),
},
},
},
Scale: &armappcontainers.Scale{
CooldownPeriod: to.Ptr[int32](350),
MaxReplicas: to.Ptr[int32](5),
MinReplicas: to.Ptr[int32](1),
PollingInterval: to.Ptr[int32](35),
Rules: []*armappcontainers.ScaleRule{
{
Name: to.Ptr("httpscalingrule"),
Custom: &armappcontainers.CustomScaleRule{
Type: to.Ptr("http"),
Metadata: map[string]*string{
"concurrentRequests": to.Ptr("50"),
},
},
},
{
Name: to.Ptr("servicebus"),
Custom: &armappcontainers.CustomScaleRule{
Type: to.Ptr("azure-servicebus"),
Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"),
Metadata: map[string]*string{
"messageCount": to.Ptr("5"),
"namespace": to.Ptr("mynamespace"),
"queueName": to.Ptr("myqueue"),
},
},
},
{
Name: to.Ptr("azure-queue"),
AzureQueue: &armappcontainers.QueueScaleRule{
AccountName: to.Ptr("account1"),
Identity: to.Ptr("system"),
QueueLength: to.Ptr[int32](1),
QueueName: to.Ptr("queue1"),
},
},
},
},
ServiceBinds: []*armappcontainers.ServiceBind{
{
Name: to.Ptr("redisService"),
ServiceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService"),
},
},
Volumes: []*armappcontainers.Volume{
{
Name: to.Ptr("azurefile"),
StorageName: to.Ptr("storage"),
StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile),
},
{
Name: to.Ptr("nfsazurefile"),
StorageName: to.Ptr("nfsStorage"),
StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile),
},
},
},
WorkloadProfileName: to.Ptr("My-GP-01"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerApp0"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"),
// Identity: &armappcontainers.ManagedServiceIdentity{
// Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
// PrincipalID: to.Ptr("24adfa4f-dedf-8dc0-ca29-b6d1a69ab319"),
// TenantID: to.Ptr("23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0"),
// UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{
// "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{
// ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"),
// PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"),
// },
// },
// },
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ContainerAppProperties{
// Configuration: &armappcontainers.Configuration{
// Dapr: &armappcontainers.Dapr{
// AppHealth: &armappcontainers.DaprAppHealth{
// Path: to.Ptr("/health"),
// Enabled: to.Ptr(true),
// ProbeIntervalSeconds: to.Ptr[int32](3),
// ProbeTimeoutMilliseconds: to.Ptr[int32](1000),
// Threshold: to.Ptr[int32](3),
// },
// AppPort: to.Ptr[int32](3000),
// AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP),
// Enabled: to.Ptr(true),
// HTTPReadBufferSize: to.Ptr[int32](30),
// MaxConcurrency: to.Ptr[int32](10),
// },
// IdentitySettings: []*armappcontainers.IdentitySettings{
// {
// Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"),
// Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll),
// },
// {
// Identity: to.Ptr("system"),
// Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit),
// },
// },
// Ingress: &armappcontainers.Ingress{
// CustomDomains: []*armappcontainers.CustomDomain{
// {
// Name: to.Ptr("www.my-name.com"),
// BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
// CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
// },
// {
// Name: to.Ptr("www.my-other-name.com"),
// BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled),
// CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"),
// },
// },
// External: to.Ptr(true),
// Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{
// {
// Name: to.Ptr("Allow work IP A subnet"),
// Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
// Action: to.Ptr(armappcontainers.ActionAllow),
// IPAddressRange: to.Ptr("192.168.1.1/32"),
// },
// {
// Name: to.Ptr("Allow work IP B subnet"),
// Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"),
// Action: to.Ptr(armappcontainers.ActionAllow),
// IPAddressRange: to.Ptr("192.168.1.1/8"),
// },
// },
// StickySessions: &armappcontainers.IngressStickySessions{
// Affinity: to.Ptr(armappcontainers.AffinitySticky),
// },
// TargetPort: to.Ptr[int32](3000),
// Traffic: []*armappcontainers.TrafficWeight{
// {
// RevisionName: to.Ptr("testcontainerApp0-ab1234"),
// },
// {
// Label: to.Ptr("staging"),
// RevisionName: to.Ptr("testcontainerApp0-ab4321"),
// },
// },
// Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto),
// },
// Runtime: &armappcontainers.Runtime{
// Java: &armappcontainers.RuntimeJava{
// EnableMetrics: to.Ptr(true),
// },
// },
// },
// EventStreamEndpoint: to.Ptr("testEndpoint"),
// LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"),
// LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// RunningStatus: to.Ptr(armappcontainers.ContainerAppRunningStatusRunning),
// Template: &armappcontainers.Template{
// Containers: []*armappcontainers.Container{
// {
// Name: to.Ptr("testcontainerApp0"),
// Image: to.Ptr("repo/testcontainerApp0:v4"),
// Probes: []*armappcontainers.ContainerAppProbe{
// {
// Type: to.Ptr(armappcontainers.TypeLiveness),
// HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{
// Path: to.Ptr("/health"),
// HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{
// {
// Name: to.Ptr("Custom-Header"),
// Value: to.Ptr("Awesome"),
// },
// },
// Port: to.Ptr[int32](8080),
// },
// InitialDelaySeconds: to.Ptr[int32](3),
// PeriodSeconds: to.Ptr[int32](3),
// },
// },
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.2),
// Memory: to.Ptr("100Mi"),
// },
// VolumeMounts: []*armappcontainers.VolumeMount{
// {
// MountPath: to.Ptr("/mnt/path1"),
// SubPath: to.Ptr("subPath1"),
// VolumeName: to.Ptr("azurefile"),
// },
// {
// MountPath: to.Ptr("/mnt/path2"),
// SubPath: to.Ptr("subPath2"),
// VolumeName: to.Ptr("nfsazurefile"),
// },
// },
// },
// },
// InitContainers: []*armappcontainers.InitContainer{
// {
// Name: to.Ptr("testinitcontainerApp0"),
// Args: []*string{
// to.Ptr("-c"),
// to.Ptr("while true; do echo hello; sleep 10;done"),
// },
// Command: []*string{
// to.Ptr("/bin/sh"),
// },
// Image: to.Ptr("repo/testcontainerApp0:v4"),
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.2),
// Memory: to.Ptr("100Mi"),
// },
// },
// },
// Scale: &armappcontainers.Scale{
// CooldownPeriod: to.Ptr[int32](350),
// MaxReplicas: to.Ptr[int32](5),
// MinReplicas: to.Ptr[int32](1),
// PollingInterval: to.Ptr[int32](35),
// Rules: []*armappcontainers.ScaleRule{
// {
// Name: to.Ptr("httpscalingrule"),
// HTTP: &armappcontainers.HTTPScaleRule{
// Metadata: map[string]*string{
// "concurrentRequests": to.Ptr("50"),
// },
// },
// },
// {
// Name: to.Ptr("servicebus"),
// Custom: &armappcontainers.CustomScaleRule{
// Type: to.Ptr("azure-servicebus"),
// Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"),
// Metadata: map[string]*string{
// "messageCount": to.Ptr("5"),
// "namespace": to.Ptr("mynamespace"),
// "queueName": to.Ptr("myqueue"),
// },
// },
// },
// {
// Name: to.Ptr("azure-queue"),
// AzureQueue: &armappcontainers.QueueScaleRule{
// AccountName: to.Ptr("account1"),
// Identity: to.Ptr("system"),
// QueueLength: to.Ptr[int32](1),
// QueueName: to.Ptr("queue1"),
// },
// },
// },
// },
// Volumes: []*armappcontainers.Volume{
// {
// Name: to.Ptr("azurefile"),
// StorageName: to.Ptr("storage"),
// StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile),
// },
// {
// Name: to.Ptr("nfsazurefile"),
// StorageName: to.Ptr("nfsStorage"),
// StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile),
// },
// },
// },
// WorkloadProfileName: to.Ptr("My-GP-01"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate.json
*/
async function createOrUpdateContainerApp() {
const credential = new DefaultAzureCredential();
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerApp0", {
identity: {
type: "SystemAssigned,UserAssigned",
userAssignedIdentities: {
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity":
{},
},
},
location: "East US",
configuration: {
dapr: {
appHealth: {
path: "/health",
enabled: true,
probeIntervalSeconds: 3,
probeTimeoutMilliseconds: 1000,
threshold: 3,
},
appPort: 3000,
appProtocol: "http",
enableApiLogging: true,
enabled: true,
httpMaxRequestSize: 10,
httpReadBufferSize: 30,
logLevel: "debug",
maxConcurrency: 10,
},
identitySettings: [
{
identity:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
lifecycle: "All",
},
{ identity: "system", lifecycle: "Init" },
],
ingress: {
additionalPortMappings: [
{ external: true, targetPort: 1234 },
{ exposedPort: 3456, external: false, targetPort: 2345 },
],
clientCertificateMode: "accept",
corsPolicy: {
allowCredentials: true,
allowedHeaders: ["HEADER1", "HEADER2"],
allowedMethods: ["GET", "POST"],
allowedOrigins: ["https://a.test.com", "https://b.test.com"],
exposeHeaders: ["HEADER3", "HEADER4"],
maxAge: 1234,
},
customDomains: [
{
name: "www.my-name.com",
bindingType: "SniEnabled",
certificateId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com",
},
{
name: "www.my-other-name.com",
bindingType: "SniEnabled",
certificateId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com",
},
],
external: true,
ipSecurityRestrictions: [
{
name: "Allow work IP A subnet",
description: "Allowing all IP's within the subnet below to access containerapp",
action: "Allow",
ipAddressRange: "192.168.1.1/32",
},
{
name: "Allow work IP B subnet",
description: "Allowing all IP's within the subnet below to access containerapp",
action: "Allow",
ipAddressRange: "192.168.1.1/8",
},
],
stickySessions: { affinity: "sticky" },
targetPort: 3000,
traffic: [{ label: "production", revisionName: "testcontainerApp0-ab1234" }],
},
maxInactiveRevisions: 10,
runtime: { java: { enableMetrics: true } },
service: { type: "redis" },
},
environmentId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
template: {
containers: [
{
name: "testcontainerApp0",
image: "repo/testcontainerApp0:v1",
probes: [
{
type: "Liveness",
httpGet: {
path: "/health",
httpHeaders: [{ name: "Custom-Header", value: "Awesome" }],
port: 8080,
},
initialDelaySeconds: 3,
periodSeconds: 3,
},
],
volumeMounts: [
{ mountPath: "/mnt/path1", subPath: "subPath1", volumeName: "azurefile" },
{ mountPath: "/mnt/path2", subPath: "subPath2", volumeName: "nfsazurefile" },
],
},
],
initContainers: [
{
name: "testinitcontainerApp0",
args: ["-c", "while true; do echo hello; sleep 10;done"],
command: ["/bin/sh"],
image: "repo/testcontainerApp0:v4",
resources: { cpu: 0.2, memory: "100Mi" },
},
],
scale: {
cooldownPeriod: 350,
maxReplicas: 5,
minReplicas: 1,
pollingInterval: 35,
rules: [
{
name: "httpscalingrule",
custom: { type: "http", metadata: { concurrentRequests: "50" } },
},
{
name: "servicebus",
custom: {
type: "azure-servicebus",
identity:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
metadata: { messageCount: "5", namespace: "mynamespace", queueName: "myqueue" },
},
},
{
name: "azure-queue",
azureQueue: {
accountName: "account1",
identity: "system",
queueLength: 1,
queueName: "queue1",
},
},
],
},
serviceBinds: [
{
name: "redisService",
serviceId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService",
},
],
volumes: [
{ name: "azurefile", storageName: "storage", storageType: "AzureFile" },
{ name: "nfsazurefile", storageName: "nfsStorage", storageType: "NfsAzureFile" },
],
},
workloadProfileName: "My-GP-01",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerApp0",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0",
"identity": {
"type": "SystemAssigned,UserAssigned",
"principalId": "24adfa4f-dedf-8dc0-ca29-b6d1a69ab319",
"tenantId": "23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0",
"userAssignedIdentities": {
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {
"clientId": "14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df",
"principalId": "74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"
}
}
},
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appHealth": {
"path": "/health",
"enabled": true,
"probeIntervalSeconds": 3,
"probeTimeoutMilliseconds": 1000,
"threshold": 3
},
"appPort": 3000,
"appProtocol": "http",
"enabled": true,
"httpReadBufferSize": 30,
"maxConcurrency": 10
},
"identitySettings": [
{
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"lifecycle": "All"
},
{
"identity": "system",
"lifecycle": "Init"
}
],
"ingress": {
"customDomains": [
{
"name": "www.my-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"
},
{
"name": "www.my-other-name.com",
"bindingType": "SniEnabled",
"certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"
}
],
"external": true,
"fqdn": "testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"ipSecurityRestrictions": [
{
"name": "Allow work IP A subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/32"
},
{
"name": "Allow work IP B subnet",
"description": "Allowing all IP's within the subnet below to access containerapp",
"action": "Allow",
"ipAddressRange": "192.168.1.1/8"
}
],
"stickySessions": {
"affinity": "sticky"
},
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerApp0-ab1234"
},
{
"label": "staging",
"revisionName": "testcontainerApp0-ab4321"
}
],
"transport": "auto"
},
"runtime": {
"java": {
"enableMetrics": true
}
}
},
"eventStreamEndpoint": "testEndpoint",
"latestReadyRevisionName": "testcontainerApp0-pjxhsye",
"latestRevisionFqdn": "testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"provisioningState": "Succeeded",
"runningStatus": "Running",
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v4",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
],
"port": 8080
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
},
"volumeMounts": [
{
"mountPath": "/mnt/path1",
"subPath": "subPath1",
"volumeName": "azurefile"
},
{
"mountPath": "/mnt/path2",
"subPath": "subPath2",
"volumeName": "nfsazurefile"
}
]
}
],
"initContainers": [
{
"name": "testinitcontainerApp0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerApp0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "httpscalingrule",
"http": {
"metadata": {
"concurrentRequests": "50"
}
}
},
{
"name": "servicebus",
"custom": {
"type": "azure-servicebus",
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"metadata": {
"messageCount": "5",
"namespace": "mynamespace",
"queueName": "myqueue"
}
}
},
{
"name": "azure-queue",
"azureQueue": {
"accountName": "account1",
"identity": "system",
"queueLength": 1,
"queueName": "queue1"
}
}
]
},
"volumes": [
{
"name": "azurefile",
"storageName": "storage",
"storageType": "AzureFile"
},
{
"name": "nfsazurefile",
"storageName": "nfsStorage",
"storageType": "NfsAzureFile"
}
]
},
"workloadProfileName": "My-GP-01"
}
}
{
"name": "testcontainerApp0",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0",
"identity": {
"type": "SystemAssigned,UserAssigned",
"principalId": "24adfa4f-dedf-8dc0-ca29-b6d1a69ab319",
"tenantId": "23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0",
"userAssignedIdentities": {
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {
"clientId": "14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df",
"principalId": "74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"
}
}
},
"location": "East US",
"properties": {
"configuration": {
"dapr": {
"appHealth": {
"path": "/health",
"enabled": true,
"probeIntervalSeconds": 3,
"probeTimeoutMilliseconds": 1000,
"threshold": 3
},
"appPort": 3000,
"appProtocol": "http",
"enabled": true,
"httpReadBufferSize": 30,
"maxConcurrency": 10
},
"identitySettings": [
{
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"lifecycle": "All"
},
{
"identity": "system",
"lifecycle": "Init"
}
],
"ingress": {
"external": true,
"fqdn": "testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerApp0-ab1234"
},
{
"label": "staging",
"revisionName": "testcontainerApp0-ab4321"
}
],
"transport": "auto"
},
"runtime": {
"java": {
"enableMetrics": true
}
}
},
"eventStreamEndpoint": "testEndpoint",
"latestRevisionFqdn": "testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"provisioningState": "InProgress",
"runningStatus": "Progressing",
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v4",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
],
"port": 8080
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
},
"volumeMounts": [
{
"mountPath": "/mnt/path1",
"subPath": "subPath1",
"volumeName": "azurefile"
},
{
"mountPath": "/mnt/path2",
"subPath": "subPath2",
"volumeName": "nfsazurefile"
}
]
}
],
"initContainers": [
{
"name": "testinitcontainerApp0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerApp0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "httpscalingrule",
"http": {
"metadata": {
"concurrentRequests": "50"
}
}
},
{
"name": "servicebus",
"custom": {
"type": "azure-servicebus",
"identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
"metadata": {
"messageCount": "5",
"namespace": "mynamespace",
"queueName": "myqueue"
}
}
},
{
"name": "azure-queue",
"azureQueue": {
"accountName": "account1",
"identity": "system",
"queueLength": 1,
"queueName": "queue1"
}
}
]
},
"volumes": [
{
"name": "azurefile",
"storageName": "storage",
"storageType": "AzureFile"
},
{
"name": "nfsazurefile",
"storageName": "nfsStorage",
"storageType": "NfsAzureFile"
}
]
}
}
}
Create or Update Container App with per-app outbound VNet subnet
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0?api-version=2026-07-01
{
"location": "East US",
"properties": {
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv",
"networking": {
"outboundVnetSubnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"
},
"template": {
"containers": [
{
"name": "testcontainerApp0",
"image": "repo/testcontainerApp0:v1",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
]
}
}
}
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerAppNetworkingConfiguration;
import com.azure.resourcemanager.appcontainers.models.ContainerResources;
import com.azure.resourcemanager.appcontainers.models.Template;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_Networking.json
*/
/**
* Sample code: Create or Update Container App with per-app outbound VNet subnet.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void createOrUpdateContainerAppWithPerAppOutboundVNetSubnet(
com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerApp0").withRegion("East US").withExistingResourceGroup("rg")
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv")
.withNetworking(new ContainerAppNetworkingConfiguration().withOutboundVnetSubnetId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"))
.withTemplate(new Template().withContainers(
Arrays.asList(new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0")
.withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_create_or_update_networking.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerApp0",
container_app_envelope={
"location": "East US",
"properties": {
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv",
"networking": {
"outboundVnetSubnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"
},
"template": {
"containers": [
{
"image": "repo/testcontainerApp0:v1",
"name": "testcontainerApp0",
"resources": {"cpu": 0.2, "memory": "100Mi"},
}
]
},
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_Networking.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_CreateOrUpdate_Networking.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateContainerAppWithPerAppOutboundVNetSubnet() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerApp0", armappcontainers.ContainerApp{
Location: to.Ptr("East US"),
Properties: &armappcontainers.ContainerAppProperties{
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv"),
Networking: &armappcontainers.ContainerAppNetworkingConfiguration{
OutboundVnetSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"),
},
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("testcontainerApp0"),
Image: to.Ptr("repo/testcontainerApp0:v1"),
Resources: &armappcontainers.ContainerResources{
CPU: to.Ptr[float64](0.2),
Memory: to.Ptr("100Mi"),
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerApp0"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"),
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ContainerAppProperties{
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv"),
// Networking: &armappcontainers.ContainerAppNetworkingConfiguration{
// OutboundVnetSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"),
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_Networking.json
*/
async function createOrUpdateContainerAppWithPerAppOutboundVNetSubnet() {
const credential = new DefaultAzureCredential();
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerApp0", {
location: "East US",
environmentId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv",
networking: {
outboundVnetSubnetId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet",
},
template: {
containers: [
{
name: "testcontainerApp0",
image: "repo/testcontainerApp0:v1",
resources: { cpu: 0.2, memory: "100Mi" },
},
],
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerApp0",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv",
"networking": {
"outboundVnetSubnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"
}
}
}
{
"name": "testcontainerApp0",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0",
"location": "East US",
"properties": {
"provisioningState": "InProgress",
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/expressenv",
"networking": {
"outboundVnetSubnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet"
}
}
}
Create or Update FunctionApp Kind
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppFunctionKind?api-version=2026-07-01
{
"kind": "functionapp",
"location": "East Us",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {
"allowInsecure": false,
"external": true,
"targetPort": 80
}
},
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"template": {
"containers": [
{
"name": "function-app-container",
"env": [
{
"name": "AzureWebJobsStorage",
"value": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
}
],
"image": "mcr.microsoft.com/azure-functions/dotnet:4",
"resources": {
"cpu": 0.5,
"memory": "1.0Gi"
}
}
],
"scale": {
"allowScalingRuleOverride": true,
"cooldownPeriod": 300,
"maxReplicas": 10,
"minReplicas": 0,
"pollingInterval": 30
}
}
}
}
import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode;
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerResources;
import com.azure.resourcemanager.appcontainers.models.EnvironmentVar;
import com.azure.resourcemanager.appcontainers.models.Ingress;
import com.azure.resourcemanager.appcontainers.models.Kind;
import com.azure.resourcemanager.appcontainers.models.Scale;
import com.azure.resourcemanager.appcontainers.models.Template;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_Kind_FunctionApp_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update FunctionApp Kind.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void
createOrUpdateFunctionAppKind(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerAppFunctionKind").withRegion("East Us")
.withExistingResourceGroup("rg")
.withManagedBy(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind")
.withKind(Kind.FUNCTIONAPP)
.withManagedEnvironmentId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3")
.withConfiguration(new Configuration().withActiveRevisionsMode(ActiveRevisionsMode.SINGLE)
.withIngress(new Ingress().withExternal(true).withTargetPort(80).withAllowInsecure(false)))
.withTemplate(new Template().withContainers(Arrays.asList(new Container()
.withImage("mcr.microsoft.com/azure-functions/dotnet:4").withName("function-app-container")
.withEnv(Arrays.asList(new EnvironmentVar().withName("AzureWebJobsStorage").withValue(
"DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"),
new EnvironmentVar().withName("FUNCTIONS_WORKER_RUNTIME").withValue("dotnet"),
new EnvironmentVar().withName("WEBSITES_ENABLE_APP_SERVICE_STORAGE").withValue("false")))
.withResources(new ContainerResources().withCpu(0.5D).withMemory("1.0Gi"))))
.withScale(new Scale().withMinReplicas(0).withMaxReplicas(10).withCooldownPeriod(300)
.withPollingInterval(30).withAllowScalingRuleOverride(true)))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_kind_function_app_create_or_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerAppFunctionKind",
container_app_envelope={
"kind": "functionapp",
"location": "East Us",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {"allowInsecure": False, "external": True, "targetPort": 80},
},
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"template": {
"containers": [
{
"env": [
{
"name": "AzureWebJobsStorage",
"value": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net",
},
{"name": "FUNCTIONS_WORKER_RUNTIME", "value": "dotnet"},
{"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", "value": "false"},
],
"image": "mcr.microsoft.com/azure-functions/dotnet:4",
"name": "function-app-container",
"resources": {"cpu": 0.5, "memory": "1.0Gi"},
}
],
"scale": {
"allowScalingRuleOverride": True,
"cooldownPeriod": 300,
"maxReplicas": 10,
"minReplicas": 0,
"pollingInterval": 30,
},
},
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_Kind_FunctionApp_CreateOrUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_Kind_FunctionApp_CreateOrUpdate.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateFunctionAppKind() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppFunctionKind", armappcontainers.ContainerApp{
Kind: to.Ptr(armappcontainers.KindFunctionapp),
Location: to.Ptr("East Us"),
ManagedBy: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind"),
Properties: &armappcontainers.ContainerAppProperties{
Configuration: &armappcontainers.Configuration{
ActiveRevisionsMode: to.Ptr(armappcontainers.ActiveRevisionsModeSingle),
Ingress: &armappcontainers.Ingress{
AllowInsecure: to.Ptr(false),
External: to.Ptr(true),
TargetPort: to.Ptr[int32](80),
},
},
ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"),
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("function-app-container"),
Env: []*armappcontainers.EnvironmentVar{
{
Name: to.Ptr("AzureWebJobsStorage"),
Value: to.Ptr("DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"),
},
{
Name: to.Ptr("FUNCTIONS_WORKER_RUNTIME"),
Value: to.Ptr("dotnet"),
},
{
Name: to.Ptr("WEBSITES_ENABLE_APP_SERVICE_STORAGE"),
Value: to.Ptr("false"),
},
},
Image: to.Ptr("mcr.microsoft.com/azure-functions/dotnet:4"),
Resources: &armappcontainers.ContainerResources{
CPU: to.Ptr[float64](0.5),
Memory: to.Ptr("1.0Gi"),
},
},
},
Scale: &armappcontainers.Scale{
AllowScalingRuleOverride: to.Ptr(true),
CooldownPeriod: to.Ptr[int32](300),
MaxReplicas: to.Ptr[int32](10),
MinReplicas: to.Ptr[int32](0),
PollingInterval: to.Ptr[int32](30),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerAppFunctionKind"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppFunctionKind"),
// Identity: &armappcontainers.ManagedServiceIdentity{
// Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeNone),
// },
// Kind: to.Ptr(armappcontainers.KindFunctionapp),
// Location: to.Ptr("East US"),
// ManagedBy: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind"),
// Properties: &armappcontainers.ContainerAppProperties{
// Configuration: &armappcontainers.Configuration{
// ActiveRevisionsMode: to.Ptr(armappcontainers.ActiveRevisionsModeSingle),
// Ingress: &armappcontainers.Ingress{
// ExposedPort: to.Ptr[int32](0),
// External: to.Ptr(true),
// Fqdn: to.Ptr("testcontainerAppFunctionKind.nicefield-53acf186.eastus.azurecontainerapps-test.io"),
// TargetPort: to.Ptr[int32](80),
// Traffic: []*armappcontainers.TrafficWeight{
// {
// LatestRevision: to.Ptr(true),
// },
// },
// Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto),
// },
// },
// EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"),
// EventStreamEndpoint: to.Ptr("https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppFunctionKind/eventstream"),
// LatestReadyRevisionName: to.Ptr("testcontainerAppFunctionKind--abc123"),
// LatestRevisionFqdn: to.Ptr("testcontainerAppFunctionKind--abc123.nicefield-53acf186.eastus.azurecontainerapps-test.io"),
// LatestRevisionName: to.Ptr("testcontainerAppFunctionKind--abc123"),
// ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"),
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// RunningStatus: to.Ptr(armappcontainers.ContainerAppRunningStatusRunning),
// Template: &armappcontainers.Template{
// Containers: []*armappcontainers.Container{
// {
// Name: to.Ptr("function-app-container"),
// Env: []*armappcontainers.EnvironmentVar{
// {
// Name: to.Ptr("AzureWebJobsStorage"),
// Value: to.Ptr("DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"),
// },
// {
// Name: to.Ptr("FUNCTIONS_WORKER_RUNTIME"),
// Value: to.Ptr("dotnet"),
// },
// {
// Name: to.Ptr("WEBSITES_ENABLE_APP_SERVICE_STORAGE"),
// Value: to.Ptr("false"),
// },
// },
// Image: to.Ptr("mcr.microsoft.com/azure-functions/dotnet:4"),
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.5),
// EphemeralStorage: to.Ptr("2Gi"),
// Memory: to.Ptr("1Gi"),
// },
// },
// },
// RevisionSuffix: to.Ptr(""),
// Scale: &armappcontainers.Scale{
// AllowScalingRuleOverride: to.Ptr(true),
// CooldownPeriod: to.Ptr[int32](300),
// MaxReplicas: to.Ptr[int32](10),
// MinReplicas: to.Ptr[int32](0),
// PollingInterval: to.Ptr[int32](30),
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_Kind_FunctionApp_CreateOrUpdate.json
*/
async function createOrUpdateFunctionAppKind() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerAppFunctionKind", {
kind: "functionapp",
location: "East Us",
managedBy:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind",
configuration: {
activeRevisionsMode: "Single",
ingress: { allowInsecure: false, external: true, targetPort: 80 },
},
managedEnvironmentId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
template: {
containers: [
{
name: "function-app-container",
env: [
{
name: "AzureWebJobsStorage",
value:
"DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net",
},
{ name: "FUNCTIONS_WORKER_RUNTIME", value: "dotnet" },
{ name: "WEBSITES_ENABLE_APP_SERVICE_STORAGE", value: "false" },
],
image: "mcr.microsoft.com/azure-functions/dotnet:4",
resources: { cpu: 0.5, memory: "1.0Gi" },
},
],
scale: {
allowScalingRuleOverride: true,
cooldownPeriod: 300,
maxReplicas: 10,
minReplicas: 0,
pollingInterval: 30,
},
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerAppFunctionKind",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppFunctionKind",
"identity": {
"type": "None"
},
"kind": "functionapp",
"location": "East US",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {
"exposedPort": 0,
"external": true,
"fqdn": "testcontainerAppFunctionKind.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"targetPort": 80,
"traffic": [
{
"latestRevision": true
}
],
"transport": "auto"
}
},
"environmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"eventStreamEndpoint": "https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppFunctionKind/eventstream",
"latestReadyRevisionName": "testcontainerAppFunctionKind--abc123",
"latestRevisionFqdn": "testcontainerAppFunctionKind--abc123.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"latestRevisionName": "testcontainerAppFunctionKind--abc123",
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"provisioningState": "Succeeded",
"runningStatus": "Running",
"template": {
"containers": [
{
"name": "function-app-container",
"env": [
{
"name": "AzureWebJobsStorage",
"value": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
}
],
"image": "mcr.microsoft.com/azure-functions/dotnet:4",
"resources": {
"cpu": 0.5,
"ephemeralStorage": "2Gi",
"memory": "1Gi"
}
}
],
"initContainers": null,
"revisionSuffix": "",
"scale": {
"allowScalingRuleOverride": true,
"cooldownPeriod": 300,
"maxReplicas": 10,
"minReplicas": 0,
"pollingInterval": 30
},
"terminationGracePeriodSeconds": null
},
"workloadProfileName": null
}
}
{
"name": "testcontainerAppFunctionKind",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppFunctionKind",
"identity": {
"type": "None"
},
"kind": "functionapp",
"location": "East US",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppFunctionKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {
"exposedPort": 0,
"external": true,
"fqdn": "testcontainerAppFunctionKind.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"targetPort": 80,
"traffic": [
{
"latestRevision": true
}
],
"transport": "auto"
}
},
"environmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"eventStreamEndpoint": "https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppFunctionKind/eventstream",
"latestReadyRevisionName": "testcontainerAppFunctionKind--abc123",
"latestRevisionFqdn": "testcontainerAppFunctionKind--abc123.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"latestRevisionName": "testcontainerAppFunctionKind--abc123",
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"provisioningState": "InProgress",
"runningStatus": "Progressing",
"template": {
"containers": [
{
"name": "function-app-container",
"env": [
{
"name": "AzureWebJobsStorage",
"value": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
}
],
"image": "mcr.microsoft.com/azure-functions/dotnet:4",
"resources": {
"cpu": 0.5,
"ephemeralStorage": "2Gi",
"memory": "1Gi"
}
}
],
"revisionSuffix": "",
"scale": {
"allowScalingRuleOverride": true,
"cooldownPeriod": 300,
"maxReplicas": 10,
"minReplicas": 0,
"pollingInterval": 30
},
"terminationGracePeriodSeconds": null
},
"workloadProfileName": null
}
}
Create or Update ManagedBy App
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppManagedBy?api-version=2026-07-01
{
"location": "East US",
"managedBy": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": true,
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerAppManagedBy-ab1234"
}
],
"transport": "tcp"
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"template": {
"containers": [
{
"name": "testcontainerAppManagedBy",
"image": "repo/testcontainerAppManagedBy:v1",
"probes": [
{
"type": "Liveness",
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {
"port": 8080
}
}
]
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "tcpscalingrule",
"tcp": {
"metadata": {
"concurrentConnections": "50"
}
}
}
]
}
}
}
}
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket;
import com.azure.resourcemanager.appcontainers.models.Ingress;
import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod;
import com.azure.resourcemanager.appcontainers.models.Scale;
import com.azure.resourcemanager.appcontainers.models.ScaleRule;
import com.azure.resourcemanager.appcontainers.models.TcpScaleRule;
import com.azure.resourcemanager.appcontainers.models.Template;
import com.azure.resourcemanager.appcontainers.models.TrafficWeight;
import com.azure.resourcemanager.appcontainers.models.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_ManagedBy_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update ManagedBy App.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void
createOrUpdateManagedByApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerAppManagedBy").withRegion("East US")
.withExistingResourceGroup("rg")
.withManagedBy(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp")
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.withConfiguration(
new Configuration()
.withIngress(
new Ingress().withExternal(true).withTargetPort(3000).withExposedPort(4000)
.withTransport(
IngressTransportMethod.TCP)
.withTraffic(Arrays
.asList(new TrafficWeight().withRevisionName("testcontainerAppManagedBy-ab1234")))))
.withTemplate(new Template()
.withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppManagedBy:v1")
.withName("testcontainerAppManagedBy")
.withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3).withPeriodSeconds(3)
.withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)).withType(Type.LIVENESS)))))
.withScale(
new Scale().withMinReplicas(1).withMaxReplicas(5).withCooldownPeriod(350).withPollingInterval(35)
.withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule")
.withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50")))))))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_managed_by_create_or_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerAppManagedBy",
container_app_envelope={
"location": "East US",
"managedBy": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": True,
"targetPort": 3000,
"traffic": [{"revisionName": "testcontainerAppManagedBy-ab1234"}],
"transport": "tcp",
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"template": {
"containers": [
{
"image": "repo/testcontainerAppManagedBy:v1",
"name": "testcontainerAppManagedBy",
"probes": [
{
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {"port": 8080},
"type": "Liveness",
}
],
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [{"name": "tcpscalingrule", "tcp": {"metadata": {"concurrentConnections": "50"}}}],
},
},
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_ManagedBy_CreateOrUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_ManagedBy_CreateOrUpdate.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateManagedByApp() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppManagedBy", armappcontainers.ContainerApp{
Location: to.Ptr("East US"),
ManagedBy: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp"),
Properties: &armappcontainers.ContainerAppProperties{
Configuration: &armappcontainers.Configuration{
Ingress: &armappcontainers.Ingress{
ExposedPort: to.Ptr[int32](4000),
External: to.Ptr(true),
TargetPort: to.Ptr[int32](3000),
Traffic: []*armappcontainers.TrafficWeight{
{
RevisionName: to.Ptr("testcontainerAppManagedBy-ab1234"),
},
},
Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP),
},
},
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("testcontainerAppManagedBy"),
Image: to.Ptr("repo/testcontainerAppManagedBy:v1"),
Probes: []*armappcontainers.ContainerAppProbe{
{
Type: to.Ptr(armappcontainers.TypeLiveness),
InitialDelaySeconds: to.Ptr[int32](3),
PeriodSeconds: to.Ptr[int32](3),
TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{
Port: to.Ptr[int32](8080),
},
},
},
},
},
Scale: &armappcontainers.Scale{
CooldownPeriod: to.Ptr[int32](350),
MaxReplicas: to.Ptr[int32](5),
MinReplicas: to.Ptr[int32](1),
PollingInterval: to.Ptr[int32](35),
Rules: []*armappcontainers.ScaleRule{
{
Name: to.Ptr("tcpscalingrule"),
TCP: &armappcontainers.TCPScaleRule{
Metadata: map[string]*string{
"concurrentConnections": to.Ptr("50"),
},
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerAppManagedBy"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppManagedBy"),
// Location: to.Ptr("East US"),
// ManagedBy: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp"),
// Properties: &armappcontainers.ContainerAppProperties{
// Configuration: &armappcontainers.Configuration{
// Ingress: &armappcontainers.Ingress{
// ExposedPort: to.Ptr[int32](4000),
// External: to.Ptr(true),
// Fqdn: to.Ptr("testcontainerAppManagedBy.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// TargetPort: to.Ptr[int32](3000),
// Traffic: []*armappcontainers.TrafficWeight{
// {
// RevisionName: to.Ptr("testcontainerAppManagedBy-ab1234"),
// },
// {
// RevisionName: to.Ptr("testcontainerAppManagedBy-ab4321"),
// },
// },
// Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP),
// },
// },
// LatestReadyRevisionName: to.Ptr("testcontainerAppManagedBy-pjxhsye"),
// LatestRevisionFqdn: to.Ptr("testcontainerAppManagedBy-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// RunningStatus: to.Ptr(armappcontainers.ContainerAppRunningStatusRunning),
// Template: &armappcontainers.Template{
// Containers: []*armappcontainers.Container{
// {
// Name: to.Ptr("testcontainerAppManagedBy"),
// Image: to.Ptr("repo/testcontainerAppManagedBy:v4"),
// Probes: []*armappcontainers.ContainerAppProbe{
// {
// Type: to.Ptr(armappcontainers.TypeLiveness),
// InitialDelaySeconds: to.Ptr[int32](3),
// PeriodSeconds: to.Ptr[int32](3),
// TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{
// Port: to.Ptr[int32](8080),
// },
// },
// },
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.2),
// Memory: to.Ptr("100Mi"),
// },
// },
// },
// Scale: &armappcontainers.Scale{
// CooldownPeriod: to.Ptr[int32](350),
// MaxReplicas: to.Ptr[int32](5),
// MinReplicas: to.Ptr[int32](1),
// PollingInterval: to.Ptr[int32](35),
// Rules: []*armappcontainers.ScaleRule{
// {
// Name: to.Ptr("tcpscalingrule"),
// TCP: &armappcontainers.TCPScaleRule{
// Metadata: map[string]*string{
// "concurrentConnections": to.Ptr("50"),
// },
// },
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_ManagedBy_CreateOrUpdate.json
*/
async function createOrUpdateManagedByApp() {
const credential = new DefaultAzureCredential();
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerAppManagedBy", {
location: "East US",
managedBy:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp",
configuration: {
ingress: {
exposedPort: 4000,
external: true,
targetPort: 3000,
traffic: [{ revisionName: "testcontainerAppManagedBy-ab1234" }],
transport: "tcp",
},
},
environmentId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
template: {
containers: [
{
name: "testcontainerAppManagedBy",
image: "repo/testcontainerAppManagedBy:v1",
probes: [
{
type: "Liveness",
initialDelaySeconds: 3,
periodSeconds: 3,
tcpSocket: { port: 8080 },
},
],
},
],
scale: {
cooldownPeriod: 350,
maxReplicas: 5,
minReplicas: 1,
pollingInterval: 35,
rules: [{ name: "tcpscalingrule", tcp: { metadata: { concurrentConnections: "50" } } }],
},
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerAppManagedBy",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppManagedBy",
"location": "East US",
"managedBy": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": true,
"fqdn": "testcontainerAppManagedBy.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerAppManagedBy-ab1234"
},
{
"revisionName": "testcontainerAppManagedBy-ab4321"
}
],
"transport": "tcp"
}
},
"latestReadyRevisionName": "testcontainerAppManagedBy-pjxhsye",
"latestRevisionFqdn": "testcontainerAppManagedBy-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"provisioningState": "Succeeded",
"runningStatus": "Running",
"template": {
"containers": [
{
"name": "testcontainerAppManagedBy",
"image": "repo/testcontainerAppManagedBy:v4",
"probes": [
{
"type": "Liveness",
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {
"port": 8080
}
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "tcpscalingrule",
"tcp": {
"metadata": {
"concurrentConnections": "50"
}
}
}
]
}
}
}
}
{
"name": "testcontainerAppManagedBy",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppManagedBy",
"location": "East US",
"managedBy": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": true,
"fqdn": "testcontainerAppManagedBy.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerAppManagedBy-ab1234"
},
{
"revisionName": "testcontainerAppManagedBy-ab4321"
}
],
"transport": "tcp"
}
},
"latestRevisionFqdn": "testcontainerAppManagedBy-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"provisioningState": "InProgress",
"runningStatus": "Progressing",
"template": {
"containers": [
{
"name": "testcontainerAppManagedBy",
"image": "repo/testcontainerAppManagedBy:v4",
"probes": [
{
"type": "Liveness",
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {
"port": 8080
}
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "tcpscalingrule",
"tcp": {
"metadata": {
"concurrentConnections": "50"
}
}
}
]
}
}
}
}
Create or Update Tcp App
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppTcp?api-version=2026-07-01
{
"location": "East US",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": true,
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerAppTcp-ab1234"
}
],
"transport": "tcp"
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"template": {
"containers": [
{
"name": "testcontainerAppTcp",
"image": "repo/testcontainerAppTcp:v1",
"probes": [
{
"type": "Liveness",
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {
"port": 8080
}
}
]
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "tcpscalingrule",
"tcp": {
"metadata": {
"concurrentConnections": "50"
}
}
}
]
}
}
}
}
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket;
import com.azure.resourcemanager.appcontainers.models.Ingress;
import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod;
import com.azure.resourcemanager.appcontainers.models.Scale;
import com.azure.resourcemanager.appcontainers.models.ScaleRule;
import com.azure.resourcemanager.appcontainers.models.TcpScaleRule;
import com.azure.resourcemanager.appcontainers.models.Template;
import com.azure.resourcemanager.appcontainers.models.TrafficWeight;
import com.azure.resourcemanager.appcontainers.models.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_TcpApp_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update Tcp App.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerAppTcp").withRegion("East US").withExistingResourceGroup("rg")
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.withConfiguration(
new Configuration()
.withIngress(
new Ingress()
.withExternal(true).withTargetPort(3000).withExposedPort(
4000)
.withTransport(IngressTransportMethod.TCP).withTraffic(
Arrays.asList(new TrafficWeight().withRevisionName("testcontainerAppTcp-ab1234")))))
.withTemplate(new Template()
.withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppTcp:v1")
.withName("testcontainerAppTcp")
.withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3).withPeriodSeconds(3)
.withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)).withType(Type.LIVENESS)))))
.withScale(
new Scale().withMinReplicas(1).withMaxReplicas(5).withCooldownPeriod(350).withPollingInterval(35)
.withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule")
.withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50")))))))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_tcp_app_create_or_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerAppTcp",
container_app_envelope={
"location": "East US",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": True,
"targetPort": 3000,
"traffic": [{"revisionName": "testcontainerAppTcp-ab1234"}],
"transport": "tcp",
}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"template": {
"containers": [
{
"image": "repo/testcontainerAppTcp:v1",
"name": "testcontainerAppTcp",
"probes": [
{
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {"port": 8080},
"type": "Liveness",
}
],
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [{"name": "tcpscalingrule", "tcp": {"metadata": {"concurrentConnections": "50"}}}],
},
},
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_TcpApp_CreateOrUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_TcpApp_CreateOrUpdate.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateTcpApp() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppTcp", armappcontainers.ContainerApp{
Location: to.Ptr("East US"),
Properties: &armappcontainers.ContainerAppProperties{
Configuration: &armappcontainers.Configuration{
Ingress: &armappcontainers.Ingress{
ExposedPort: to.Ptr[int32](4000),
External: to.Ptr(true),
TargetPort: to.Ptr[int32](3000),
Traffic: []*armappcontainers.TrafficWeight{
{
RevisionName: to.Ptr("testcontainerAppTcp-ab1234"),
},
},
Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP),
},
},
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("testcontainerAppTcp"),
Image: to.Ptr("repo/testcontainerAppTcp:v1"),
Probes: []*armappcontainers.ContainerAppProbe{
{
Type: to.Ptr(armappcontainers.TypeLiveness),
InitialDelaySeconds: to.Ptr[int32](3),
PeriodSeconds: to.Ptr[int32](3),
TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{
Port: to.Ptr[int32](8080),
},
},
},
},
},
Scale: &armappcontainers.Scale{
CooldownPeriod: to.Ptr[int32](350),
MaxReplicas: to.Ptr[int32](5),
MinReplicas: to.Ptr[int32](1),
PollingInterval: to.Ptr[int32](35),
Rules: []*armappcontainers.ScaleRule{
{
Name: to.Ptr("tcpscalingrule"),
TCP: &armappcontainers.TCPScaleRule{
Metadata: map[string]*string{
"concurrentConnections": to.Ptr("50"),
},
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerAppTcp"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppTcp"),
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ContainerAppProperties{
// Configuration: &armappcontainers.Configuration{
// Ingress: &armappcontainers.Ingress{
// ExposedPort: to.Ptr[int32](4000),
// External: to.Ptr(true),
// Fqdn: to.Ptr("testcontainerAppTcp.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// TargetPort: to.Ptr[int32](3000),
// Traffic: []*armappcontainers.TrafficWeight{
// {
// RevisionName: to.Ptr("testcontainerAppTcp-ab1234"),
// },
// {
// RevisionName: to.Ptr("testcontainerAppTcp-ab4321"),
// },
// },
// Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP),
// },
// },
// LatestReadyRevisionName: to.Ptr("testcontainerAppTcp-pjxhsye"),
// LatestRevisionFqdn: to.Ptr("testcontainerAppTcp-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"),
// ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// RunningStatus: to.Ptr(armappcontainers.ContainerAppRunningStatusRunning),
// Template: &armappcontainers.Template{
// Containers: []*armappcontainers.Container{
// {
// Name: to.Ptr("testcontainerAppTcp"),
// Image: to.Ptr("repo/testcontainerAppTcp:v4"),
// Probes: []*armappcontainers.ContainerAppProbe{
// {
// Type: to.Ptr(armappcontainers.TypeLiveness),
// InitialDelaySeconds: to.Ptr[int32](3),
// PeriodSeconds: to.Ptr[int32](3),
// TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{
// Port: to.Ptr[int32](8080),
// },
// },
// },
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](0.2),
// Memory: to.Ptr("100Mi"),
// },
// },
// },
// Scale: &armappcontainers.Scale{
// CooldownPeriod: to.Ptr[int32](350),
// MaxReplicas: to.Ptr[int32](5),
// MinReplicas: to.Ptr[int32](1),
// PollingInterval: to.Ptr[int32](35),
// Rules: []*armappcontainers.ScaleRule{
// {
// Name: to.Ptr("tcpscalingrule"),
// TCP: &armappcontainers.TCPScaleRule{
// Metadata: map[string]*string{
// "concurrentConnections": to.Ptr("50"),
// },
// },
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_TcpApp_CreateOrUpdate.json
*/
async function createOrUpdateTcpApp() {
const credential = new DefaultAzureCredential();
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerAppTcp", {
location: "East US",
configuration: {
ingress: {
exposedPort: 4000,
external: true,
targetPort: 3000,
traffic: [{ revisionName: "testcontainerAppTcp-ab1234" }],
transport: "tcp",
},
},
environmentId:
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
template: {
containers: [
{
name: "testcontainerAppTcp",
image: "repo/testcontainerAppTcp:v1",
probes: [
{
type: "Liveness",
initialDelaySeconds: 3,
periodSeconds: 3,
tcpSocket: { port: 8080 },
},
],
},
],
scale: {
cooldownPeriod: 350,
maxReplicas: 5,
minReplicas: 1,
pollingInterval: 35,
rules: [{ name: "tcpscalingrule", tcp: { metadata: { concurrentConnections: "50" } } }],
},
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerAppTcp",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppTcp",
"location": "East US",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": true,
"fqdn": "testcontainerAppTcp.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerAppTcp-ab1234"
},
{
"revisionName": "testcontainerAppTcp-ab4321"
}
],
"transport": "tcp"
}
},
"latestReadyRevisionName": "testcontainerAppTcp-pjxhsye",
"latestRevisionFqdn": "testcontainerAppTcp-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"provisioningState": "Succeeded",
"runningStatus": "Running",
"template": {
"containers": [
{
"name": "testcontainerAppTcp",
"image": "repo/testcontainerAppTcp:v4",
"probes": [
{
"type": "Liveness",
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {
"port": 8080
}
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "tcpscalingrule",
"tcp": {
"metadata": {
"concurrentConnections": "50"
}
}
}
]
}
}
}
}
{
"name": "testcontainerAppTcp",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppTcp",
"location": "East US",
"properties": {
"configuration": {
"ingress": {
"exposedPort": 4000,
"external": true,
"fqdn": "testcontainerAppTcp.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"targetPort": 3000,
"traffic": [
{
"revisionName": "testcontainerAppTcp-ab1234"
},
{
"revisionName": "testcontainerAppTcp-ab4321"
}
],
"transport": "tcp"
}
},
"latestRevisionFqdn": "testcontainerAppTcp-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io",
"managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"provisioningState": "InProgress",
"runningStatus": "Progressing",
"template": {
"containers": [
{
"name": "testcontainerAppTcp",
"image": "repo/testcontainerAppTcp:v4",
"probes": [
{
"type": "Liveness",
"initialDelaySeconds": 3,
"periodSeconds": 3,
"tcpSocket": {
"port": 8080
}
}
],
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 5,
"minReplicas": 1,
"pollingInterval": 35,
"rules": [
{
"name": "tcpscalingrule",
"tcp": {
"metadata": {
"concurrentConnections": "50"
}
}
}
]
}
}
}
}
Create or Update WorkflowApp Kind
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppKind?api-version=2026-07-01
{
"kind": "workflowapp",
"location": "East Us",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {
"allowInsecure": false,
"external": true,
"targetPort": 443
}
},
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"template": {
"containers": [
{
"name": "logicapps-container",
"image": "default/logicapps-base:latest",
"resources": {
"cpu": 1,
"memory": "2.0Gi"
}
}
],
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 30,
"minReplicas": 1,
"pollingInterval": 35
}
}
}
}
import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode;
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
import com.azure.resourcemanager.appcontainers.models.ContainerResources;
import com.azure.resourcemanager.appcontainers.models.Ingress;
import com.azure.resourcemanager.appcontainers.models.Kind;
import com.azure.resourcemanager.appcontainers.models.Scale;
import com.azure.resourcemanager.appcontainers.models.Template;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerApps CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-07-01/ContainerApps_Kind_WorkflowApp_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update WorkflowApp Kind.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void
createOrUpdateWorkflowAppKind(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerApps().define("testcontainerAppKind").withRegion("East Us").withExistingResourceGroup("rg")
.withManagedBy(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind")
.withKind(Kind.WORKFLOWAPP)
.withManagedEnvironmentId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3")
.withConfiguration(new Configuration().withActiveRevisionsMode(ActiveRevisionsMode.SINGLE)
.withIngress(new Ingress().withExternal(true).withTargetPort(443).withAllowInsecure(false)))
.withTemplate(new Template()
.withContainers(Arrays
.asList(new Container().withImage("default/logicapps-base:latest").withName("logicapps-container")
.withResources(new ContainerResources().withCpu(1.0D).withMemory("2.0Gi"))))
.withScale(
new Scale().withMinReplicas(1).withMaxReplicas(30).withCooldownPeriod(350).withPollingInterval(35)))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python container_apps_kind_workflow_app_create_or_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.container_apps.begin_create_or_update(
resource_group_name="rg",
container_app_name="testcontainerAppKind",
container_app_envelope={
"kind": "workflowapp",
"location": "East Us",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {"allowInsecure": False, "external": True, "targetPort": 443},
},
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"template": {
"containers": [
{
"image": "default/logicapps-base:latest",
"name": "logicapps-container",
"resources": {"cpu": 1, "memory": "2.0Gi"},
}
],
"scale": {"cooldownPeriod": 350, "maxReplicas": 30, "minReplicas": 1, "pollingInterval": 35},
},
},
},
).result()
print(response)
# x-ms-original-file: 2026-07-01/ContainerApps_Kind_WorkflowApp_CreateOrUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v5"
)
// Generated from example definition: 2026-07-01/ContainerApps_Kind_WorkflowApp_CreateOrUpdate.json
func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateWorkflowAppKind() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppKind", armappcontainers.ContainerApp{
Kind: to.Ptr(armappcontainers.KindWorkflowapp),
Location: to.Ptr("East Us"),
ManagedBy: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind"),
Properties: &armappcontainers.ContainerAppProperties{
Configuration: &armappcontainers.Configuration{
ActiveRevisionsMode: to.Ptr(armappcontainers.ActiveRevisionsModeSingle),
Ingress: &armappcontainers.Ingress{
AllowInsecure: to.Ptr(false),
External: to.Ptr(true),
TargetPort: to.Ptr[int32](443),
},
},
ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"),
Template: &armappcontainers.Template{
Containers: []*armappcontainers.Container{
{
Name: to.Ptr("logicapps-container"),
Image: to.Ptr("default/logicapps-base:latest"),
Resources: &armappcontainers.ContainerResources{
CPU: to.Ptr[float64](1),
Memory: to.Ptr("2.0Gi"),
},
},
},
Scale: &armappcontainers.Scale{
CooldownPeriod: to.Ptr[int32](350),
MaxReplicas: to.Ptr[int32](30),
MinReplicas: to.Ptr[int32](1),
PollingInterval: to.Ptr[int32](35),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armappcontainers.ContainerAppsClientCreateOrUpdateResponse{
// ContainerApp: armappcontainers.ContainerApp{
// Name: to.Ptr("testcontainerAppKind"),
// Type: to.Ptr("Microsoft.App/containerApps"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppKind"),
// Identity: &armappcontainers.ManagedServiceIdentity{
// Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeNone),
// },
// Kind: to.Ptr(armappcontainers.KindWorkflowapp),
// Location: to.Ptr("East US"),
// ManagedBy: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind"),
// Properties: &armappcontainers.ContainerAppProperties{
// Configuration: &armappcontainers.Configuration{
// ActiveRevisionsMode: to.Ptr(armappcontainers.ActiveRevisionsModeSingle),
// Ingress: &armappcontainers.Ingress{
// ExposedPort: to.Ptr[int32](0),
// External: to.Ptr(true),
// Fqdn: to.Ptr("testcontainerAppKind.nicefield-53acf186.eastus.azurecontainerapps-test.io"),
// TargetPort: to.Ptr[int32](80),
// Traffic: []*armappcontainers.TrafficWeight{
// {
// LatestRevision: to.Ptr(true),
// },
// },
// Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto),
// },
// },
// EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"),
// EventStreamEndpoint: to.Ptr("https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppKind/eventstream"),
// LatestReadyRevisionName: to.Ptr("testcontainerAppKind--2rltv14"),
// LatestRevisionFqdn: to.Ptr("testcontainerAppKind--2rltv14.nicefield-53acf186.eastus.azurecontainerapps-test.io"),
// LatestRevisionName: to.Ptr("testcontainerAppKind--2rltv14"),
// ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"),
// ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded),
// RunningStatus: to.Ptr(armappcontainers.ContainerAppRunningStatusRunning),
// Template: &armappcontainers.Template{
// Containers: []*armappcontainers.Container{
// {
// Name: to.Ptr("logicapps-container"),
// Image: to.Ptr("default/logicapps-base:latest"),
// Resources: &armappcontainers.ContainerResources{
// CPU: to.Ptr[float64](1),
// EphemeralStorage: to.Ptr("4Gi"),
// Memory: to.Ptr("2Gi"),
// },
// },
// },
// RevisionSuffix: to.Ptr(""),
// Scale: &armappcontainers.Scale{
// CooldownPeriod: to.Ptr[int32](350),
// MaxReplicas: to.Ptr[int32](30),
// MinReplicas: to.Ptr[int32](1),
// PollingInterval: to.Ptr[int32](35),
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to create or update a Container App.
*
* @summary create or update a Container App.
* x-ms-original-file: 2026-07-01/ContainerApps_Kind_WorkflowApp_CreateOrUpdate.json
*/
async function createOrUpdateWorkflowAppKind() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.createOrUpdate("rg", "testcontainerAppKind", {
kind: "workflowapp",
location: "East Us",
managedBy:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind",
configuration: {
activeRevisionsMode: "Single",
ingress: { allowInsecure: false, external: true, targetPort: 443 },
},
managedEnvironmentId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
template: {
containers: [
{
name: "logicapps-container",
image: "default/logicapps-base:latest",
resources: { cpu: 1, memory: "2.0Gi" },
},
],
scale: { cooldownPeriod: 350, maxReplicas: 30, minReplicas: 1, pollingInterval: 35 },
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "testcontainerAppKind",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppKind",
"identity": {
"type": "None"
},
"kind": "workflowapp",
"location": "East US",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {
"exposedPort": 0,
"external": true,
"fqdn": "testcontainerAppKind.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"targetPort": 80,
"traffic": [
{
"latestRevision": true
}
],
"transport": "auto"
}
},
"environmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"eventStreamEndpoint": "https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppKind/eventstream",
"latestReadyRevisionName": "testcontainerAppKind--2rltv14",
"latestRevisionFqdn": "testcontainerAppKind--2rltv14.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"latestRevisionName": "testcontainerAppKind--2rltv14",
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"provisioningState": "Succeeded",
"runningStatus": "Running",
"template": {
"containers": [
{
"name": "logicapps-container",
"image": "default/logicapps-base:latest",
"resources": {
"cpu": 1,
"ephemeralStorage": "4Gi",
"memory": "2Gi"
}
}
],
"initContainers": null,
"revisionSuffix": "",
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 30,
"minReplicas": 1,
"pollingInterval": 35
},
"terminationGracePeriodSeconds": null
},
"workloadProfileName": null
}
}
{
"name": "testcontainerAppKind",
"type": "Microsoft.App/containerApps",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppKind",
"identity": {
"type": "None"
},
"kind": "workflowapp",
"location": "East US",
"managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind",
"properties": {
"configuration": {
"activeRevisionsMode": "Single",
"ingress": {
"exposedPort": 0,
"external": true,
"fqdn": "testcontainerAppKind.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"targetPort": 80,
"traffic": [
{
"latestRevision": true
}
],
"transport": "auto"
}
},
"environmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"eventStreamEndpoint": "https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppKind/eventstream",
"latestReadyRevisionName": "testcontainerAppKind--2rltv14",
"latestRevisionFqdn": "testcontainerAppKind--2rltv14.nicefield-53acf186.eastus.azurecontainerapps-test.io",
"latestRevisionName": "testcontainerAppKind--2rltv14",
"managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3",
"provisioningState": "InProgress",
"runningStatus": "Progressing",
"template": {
"containers": [
{
"name": "logicapps-container",
"image": "default/logicapps-base:latest",
"resources": {
"cpu": 1,
"ephemeralStorage": "4Gi",
"memory": "2Gi"
}
}
],
"revisionSuffix": "",
"scale": {
"cooldownPeriod": 350,
"maxReplicas": 30,
"minReplicas": 1,
"pollingInterval": 35
},
"terminationGracePeriodSeconds": null
},
"workloadProfileName": null
}
}
Definitions
| Name |
Description |
|
Action
|
Allow or Deny rules to determine for incoming IP. Note: Rules can only consist of ALL Allow or ALL Deny
|
|
ActiveRevisionsMode
|
ActiveRevisionsMode controls how active revisions are handled for the Container app:
<list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the default.</item></list>
|
|
Affinity
|
Sticky Session Affinity
|
|
AppProtocol
|
Tells Dapr which protocol your application is using. Valid options are http and grpc. Default is http
|
|
BindingType
|
Custom Domain binding type.
|
|
Configuration
|
Non versioned Container App configuration properties that define the mutable settings of a Container app
|
|
Container
|
Container App container definition
|
|
ContainerApp
|
Container App.
|
|
ContainerAppNetworkingConfiguration
|
Networking configuration for a Container App. Only supported for Container Apps deployed into an Express managed environment.
|
|
ContainerAppProbe
|
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
|
|
ContainerAppProbeHttpGet
|
HTTPGet specifies the http request to perform.
|
|
ContainerAppProbeHttpGetHttpHeadersItem
|
HTTPHeader describes a custom header to be used in HTTP probes
|
|
ContainerAppProbeTcpSocket
|
TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
|
|
ContainerAppProvisioningState
|
Provisioning state of the Container App.
|
|
ContainerAppRunningStatus
|
Running status of the Container App.
|
|
ContainerResources
|
Container App container resource requirements.
|
|
CorsPolicy
|
Cross-Origin-Resource-Sharing policy
|
|
createdByType
|
The type of identity that created the resource.
|
|
CustomDomain
|
Custom Domain of a Container App
|
|
CustomScaleRule
|
Container App container Custom scaling rule.
|
|
Dapr
|
Container App Dapr configuration.
|
|
DaprAppHealth
|
Dapr application health check configuration
|
|
EnvironmentVar
|
Container App container environment variable.
|
|
ErrorAdditionalInfo
|
The resource management error additional info.
|
|
ErrorDetail
|
The error detail.
|
|
ErrorResponse
|
Error response
|
|
ExtendedLocation
|
The complex type of the extended location.
|
|
ExtendedLocationTypes
|
The type of extendedLocation.
|
|
HttpScaleRule
|
Container App container Http scaling rule.
|
|
IdentitySettings
|
Optional settings for a Managed Identity that is assigned to the Container App.
|
|
IdentitySettingsLifeCycle
|
Use to select the lifecycle stages of a Container App during which the Managed Identity should be available.
|
|
Ingress
|
Container App Ingress configuration.
|
|
IngressClientCertificateMode
|
Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require a client certificate. Require indicates server requires a client certificate.
|
|
IngressPortMapping
|
Port mappings of container app ingress
|
|
IngressStickySessions
|
Sticky Sessions for Single Revision Mode
|
|
IngressTransportMethod
|
Ingress transport protocol
|
|
InitContainer
|
Container App init container definition
|
|
IpSecurityRestrictionRule
|
Rule to restrict incoming IP address.
|
|
Kind
|
Metadata to represent the container app kind, representing if a container app is workflowapp or functionapp.
|
|
LogLevel
|
Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info.
|
|
ManagedServiceIdentity
|
Managed service identity (system assigned and/or user assigned identities)
|
|
ManagedServiceIdentityType
|
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
|
|
QueueScaleRule
|
Container App container Azure Queue based scaling rule.
|
|
RegistryCredentials
|
Container App Private Registry
|
|
Runtime
|
Container App Runtime configuration.
|
|
RuntimeJava
|
Java app configuration
|
|
Scale
|
Container App scaling configurations.
|
|
ScaleRule
|
Container App container scaling rule.
|
|
ScaleRuleAuth
|
Auth Secrets for Scale Rule
|
|
Scheme
|
Scheme to use for connecting to the host. Defaults to HTTP.
|
|
Secret
|
Secret definition.
|
|
SecretVolumeItem
|
Secret to be added to volume.
|
|
Service
|
Container App to be a dev service
|
|
ServiceBind
|
Configuration to bind a ContainerApp to a dev ContainerApp Service
|
|
StorageType
|
Storage type for the volume. If not provided, use EmptyDir.
|
|
systemData
|
Metadata pertaining to creation and last modification of the resource.
|
|
TcpScaleRule
|
Container App container Tcp scaling rule.
|
|
Template
|
Container App versioned application definition.
Defines the desired state of an immutable revision.
Any changes to this section Will result in a new revision being created
|
|
TrafficWeight
|
Traffic weight assigned to a revision
|
|
Type
|
The type of probe.
|
|
UserAssignedIdentity
|
User assigned identity properties
|
|
Volume
|
Volume definitions for the Container App.
|
|
VolumeMount
|
Volume mount for the Container App.
|
Action
Enumeration
Allow or Deny rules to determine for incoming IP. Note: Rules can only consist of ALL Allow or ALL Deny
| Value |
Description |
|
Allow
|
Allow
|
|
Deny
|
Deny
|
ActiveRevisionsMode
Enumeration
ActiveRevisionsMode controls how active revisions are handled for the Container app:
<list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the default.</item></list>
| Value |
Description |
|
Multiple
|
Multiple
|
|
Single
|
Single
|
Affinity
Enumeration
Sticky Session Affinity
| Value |
Description |
|
sticky
|
sticky
|
|
none
|
none
|
AppProtocol
Enumeration
Tells Dapr which protocol your application is using. Valid options are http and grpc. Default is http
| Value |
Description |
|
http
|
http
|
|
grpc
|
grpc
|
BindingType
Enumeration
Custom Domain binding type.
| Value |
Description |
|
Disabled
|
Disabled
|
|
SniEnabled
|
SniEnabled
|
|
Auto
|
Auto
|
Configuration
Object
Non versioned Container App configuration properties that define the mutable settings of a Container app
| Name |
Type |
Default value |
Description |
|
activeRevisionsMode
|
ActiveRevisionsMode
|
Single
|
ActiveRevisionsMode controls how active revisions are handled for the Container app:
<list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the default.</item></list>
|
|
dapr
|
Dapr
|
|
Dapr configuration for the Container App.
|
|
identitySettings
|
IdentitySettings[]
|
|
Optional settings for Managed Identities that are assigned to the Container App. If a Managed Identity is not specified here, default settings will be used.
|
|
ingress
|
Ingress
|
|
Ingress configurations.
|
|
maxInactiveRevisions
|
integer
(int32)
|
|
Optional. Max inactive revisions a Container App can have.
|
|
registries
|
RegistryCredentials[]
|
|
Collection of private container registry credentials for containers used by the Container app
|
|
runtime
|
Runtime
|
|
App runtime configuration for the Container App.
|
|
secrets
|
Secret[]
|
|
Collection of secrets used by a Container app
|
|
service
|
Service
|
|
Container App to be a dev Container App Service
|
Container
Object
Container App container definition
| Name |
Type |
Description |
|
args
|
string[]
|
Container start command arguments.
|
|
command
|
string[]
|
Container start command.
|
|
env
|
EnvironmentVar[]
|
Container environment variables.
|
|
image
|
string
|
Container image tag.
|
|
name
|
string
|
Custom container name.
|
|
probes
|
ContainerAppProbe[]
|
List of probes for the container.
|
|
resources
|
ContainerResources
|
Container resource requirements.
|
|
volumeMounts
|
VolumeMount[]
|
Container volume mounts.
|
ContainerApp
Object
Container App.
| Name |
Type |
Description |
|
extendedLocation
|
ExtendedLocation
|
The complex type of the extended location.
|
|
id
|
string
(arm-id)
|
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
ManagedServiceIdentity
|
managed identities for the Container App to interact with other Azure services without maintaining any secrets or credentials in code.
|
|
kind
|
Kind
|
Metadata to represent the container app kind, representing if a container app is workflowapp or functionapp.
|
|
location
|
string
|
The geo-location where the resource lives
|
|
managedBy
|
string
|
The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource.
|
|
name
|
string
|
The name of the resource
|
|
properties.configuration
|
Configuration
|
Non versioned Container App configuration properties.
|
|
properties.customDomainVerificationId
|
string
|
Id used to verify domain name ownership
|
|
properties.environmentId
|
string
|
Resource ID of environment.
|
|
properties.eventStreamEndpoint
|
string
|
The endpoint of the eventstream of the container app.
|
|
properties.latestReadyRevisionName
|
string
|
Name of the latest ready revision of the Container App.
|
|
properties.latestRevisionFqdn
|
string
|
Fully Qualified Domain Name of the latest revision of the Container App.
|
|
properties.latestRevisionName
|
string
|
Name of the latest revision of the Container App.
|
|
properties.managedEnvironmentId
|
string
|
Deprecated. Resource ID of the Container App's environment.
|
|
properties.networking
|
ContainerAppNetworkingConfiguration
|
Networking configuration for the Container App.
|
|
properties.outboundIpAddresses
|
string[]
|
Outbound IP Addresses for container app.
|
|
properties.provisioningState
|
ContainerAppProvisioningState
|
Provisioning state of the Container App.
|
|
properties.runningStatus
|
ContainerAppRunningStatus
|
Running status of the Container App.
|
|
properties.template
|
Template
|
Container App versioned application definition.
|
|
properties.workloadProfileName
|
string
|
Workload profile name to pin for container app execution.
|
|
systemData
|
systemData
|
Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
|
tags
|
object
|
Resource tags.
|
|
type
|
string
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
ContainerAppNetworkingConfiguration
Object
Networking configuration for a Container App. Only supported for Container Apps deployed into an Express managed environment.
| Name |
Type |
Description |
|
outboundVnetSubnetId
|
string
|
Resource ID of a subnet used for outbound (egress) traffic from this Container App. Only supported for Container Apps in an Express managed environment. Mutually exclusive with the environment-level VNet configuration and immutable after the Container App is created.
|
ContainerAppProbe
Object
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
| Name |
Type |
Description |
|
failureThreshold
|
integer
(int32)
|
Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10.
|
|
httpGet
|
ContainerAppProbeHttpGet
|
HTTPGet specifies the http request to perform.
|
|
initialDelaySeconds
|
integer
(int32)
|
Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60.
|
|
periodSeconds
|
integer
(int32)
|
How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240.
|
|
successThreshold
|
integer
(int32)
|
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10.
|
|
tcpSocket
|
ContainerAppProbeTcpSocket
|
TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
|
|
terminationGracePeriodSeconds
|
integer
(int64)
|
Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour)
|
|
timeoutSeconds
|
integer
(int32)
|
Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240.
|
|
type
|
Type
|
The type of probe.
|
ContainerAppProbeHttpGet
Object
HTTPGet specifies the http request to perform.
| Name |
Type |
Description |
|
host
|
string
|
Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead.
|
|
httpHeaders
|
ContainerAppProbeHttpGetHttpHeadersItem[]
|
Custom headers to set in the request. HTTP allows repeated headers.
|
|
path
|
string
|
Path to access on the HTTP server.
|
|
port
|
integer
(int32)
|
Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
|
|
scheme
|
Scheme
|
Scheme to use for connecting to the host. Defaults to HTTP.
|
Object
HTTPHeader describes a custom header to be used in HTTP probes
| Name |
Type |
Description |
|
name
|
string
|
The header field name
|
|
value
|
string
|
The header field value
|
ContainerAppProbeTcpSocket
Object
TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
| Name |
Type |
Description |
|
host
|
string
|
Optional: Host name to connect to, defaults to the pod IP.
|
|
port
|
integer
(int32)
|
Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
|
ContainerAppProvisioningState
Enumeration
Provisioning state of the Container App.
| Value |
Description |
|
InProgress
|
InProgress
|
|
Succeeded
|
Succeeded
|
|
Failed
|
Failed
|
|
Canceled
|
Canceled
|
|
Deleting
|
Deleting
|
ContainerAppRunningStatus
Enumeration
Running status of the Container App.
| Value |
Description |
|
Progressing
|
Container App is transitioning between Stopped and Running states.
|
|
Running
|
Container App is in Running state.
|
|
Stopped
|
Container App is in Stopped state.
|
|
Suspended
|
Container App Job is in Suspended state.
|
|
Ready
|
Container App Job is in Ready state.
|
ContainerResources
Object
Container App container resource requirements.
| Name |
Type |
Description |
|
cpu
|
number
(double)
|
Required CPU in cores, e.g. 0.5
|
|
ephemeralStorage
|
string
|
Ephemeral Storage, e.g. "1Gi"
|
|
memory
|
string
|
Required memory, e.g. "250Mb"
|
CorsPolicy
Object
Cross-Origin-Resource-Sharing policy
| Name |
Type |
Description |
|
allowCredentials
|
boolean
|
Specifies whether the resource allows credentials
|
|
allowedHeaders
|
string[]
|
Specifies the content for the access-control-allow-headers header
|
|
allowedMethods
|
string[]
|
Specifies the content for the access-control-allow-methods header
|
|
allowedOrigins
|
string[]
|
Specifies the content for the access-control-allow-origins header
|
|
exposeHeaders
|
string[]
|
Specifies the content for the access-control-expose-headers header
|
|
maxAge
|
integer
(int32)
|
Specifies the content for the access-control-max-age header
|
createdByType
Enumeration
The type of identity that created the resource.
| Value |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
CustomDomain
Object
Custom Domain of a Container App
| Name |
Type |
Description |
|
bindingType
|
BindingType
|
Custom Domain binding type.
|
|
certificateId
|
string
|
Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment.
|
|
name
|
string
|
Hostname.
|
CustomScaleRule
Object
Container App container Custom scaling rule.
| Name |
Type |
Description |
|
auth
|
ScaleRuleAuth[]
|
Authentication secrets for the custom scale rule.
|
|
identity
|
string
|
The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity.
|
|
metadata
|
object
|
Metadata properties to describe custom scale rule.
|
|
type
|
string
|
Type of the custom scale rule
eg: azure-servicebus, redis etc.
|
Dapr
Object
Container App Dapr configuration.
| Name |
Type |
Default value |
Description |
|
appHealth
|
DaprAppHealth
|
|
Dapr application health check configuration
|
|
appId
|
string
|
|
Dapr application identifier
|
|
appPort
|
integer
(int32)
|
|
Tells Dapr which port your application is listening on
|
|
appProtocol
|
AppProtocol
|
http
|
Tells Dapr which protocol your application is using. Valid options are http and grpc. Default is http
|
|
enableApiLogging
|
boolean
|
|
Enables API logging for the Dapr sidecar
|
|
enabled
|
boolean
|
False
|
Boolean indicating if the Dapr side car is enabled
|
|
httpMaxRequestSize
|
integer
(int32)
|
|
Increasing max size of request body http and grpc servers parameter in MB to handle uploading of big files. Default is 4 MB.
|
|
httpReadBufferSize
|
integer
(int32)
|
|
Dapr max size of http header read buffer in KB to handle when sending multi-KB headers. Default is 65KB.
|
|
logLevel
|
LogLevel
|
|
Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info.
|
|
maxConcurrency
|
integer
(int32)
|
|
Maximum number of concurrent requests, events handled by the Dapr sidecar
|
DaprAppHealth
Object
Dapr application health check configuration
| Name |
Type |
Description |
|
enabled
|
boolean
|
Boolean indicating if the health probe is enabled
|
|
path
|
string
|
Path for the health probe
|
|
probeIntervalSeconds
|
integer
(int32)
minimum: 1
|
Interval for the health probe in seconds
|
|
probeTimeoutMilliseconds
|
integer
(int32)
minimum: 1
|
Timeout for the health probe in milliseconds
|
|
threshold
|
integer
(int32)
minimum: 1
|
Threshold for the health probe
|
EnvironmentVar
Object
Container App container environment variable.
| Name |
Type |
Description |
|
name
|
string
|
Environment variable name.
|
|
secretRef
|
string
|
Name of the Container App secret from which to pull the environment variable value.
|
|
value
|
string
|
Non-secret environment variable value.
|
ErrorAdditionalInfo
Object
The resource management error additional info.
| Name |
Type |
Description |
|
info
|
object
|
The additional info.
|
|
type
|
string
|
The additional info type.
|
ErrorDetail
Object
The error detail.
| Name |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
|
code
|
string
|
The error code.
|
|
details
|
ErrorDetail[]
|
The error details.
|
|
message
|
string
|
The error message.
|
|
target
|
string
|
The error target.
|
ErrorResponse
Object
Error response
| Name |
Type |
Description |
|
error
|
ErrorDetail
|
The error object.
|
ExtendedLocation
Object
The complex type of the extended location.
| Name |
Type |
Description |
|
name
|
string
|
The name of the extended location.
|
|
type
|
ExtendedLocationTypes
|
The type of the extended location.
|
ExtendedLocationTypes
Enumeration
The type of extendedLocation.
| Value |
Description |
|
CustomLocation
|
CustomLocation
|
HttpScaleRule
Object
Container App container Http scaling rule.
| Name |
Type |
Description |
|
auth
|
ScaleRuleAuth[]
|
Authentication secrets for the custom scale rule.
|
|
identity
|
string
|
The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity.
|
|
metadata
|
object
|
Metadata properties to describe http scale rule.
|
IdentitySettings
Object
Optional settings for a Managed Identity that is assigned to the Container App.
| Name |
Type |
Default value |
Description |
|
identity
|
string
|
|
The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity.
|
|
lifecycle
|
IdentitySettingsLifeCycle
|
All
|
Use to select the lifecycle stages of a Container App during which the Managed Identity should be available.
|
IdentitySettingsLifeCycle
Enumeration
Use to select the lifecycle stages of a Container App during which the Managed Identity should be available.
| Value |
Description |
|
None
|
Do not use managed identity during any lifecycle stage.
|
|
Main
|
Use managed identity during the main stage of the Container App lifecycle.
|
|
Init
|
Use managed identity during the init stage of the Container App lifecycle.
|
|
All
|
Use managed identity during all lifecycle stages of the Container App.
|
Ingress
Object
Container App Ingress configuration.
| Name |
Type |
Default value |
Description |
|
additionalPortMappings
|
IngressPortMapping[]
|
|
Settings to expose additional ports on container app
|
|
allowInsecure
|
boolean
|
False
|
Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections
|
|
clientCertificateMode
|
IngressClientCertificateMode
|
|
Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require a client certificate. Require indicates server requires a client certificate.
|
|
corsPolicy
|
CorsPolicy
|
|
CORS policy for container app
|
|
customDomains
|
CustomDomain[]
|
|
custom domain bindings for Container Apps' hostnames.
|
|
exposedPort
|
integer
(int32)
|
|
Exposed Port in containers for TCP traffic from ingress
|
|
external
|
boolean
|
False
|
Bool indicating if app exposes an external http endpoint
|
|
fqdn
|
string
|
|
Hostname.
|
|
ipSecurityRestrictions
|
IpSecurityRestrictionRule[]
|
|
Rules to restrict incoming IP address.
|
|
stickySessions
|
IngressStickySessions
|
|
Sticky Sessions for Single Revision Mode
|
|
targetPort
|
integer
(int32)
|
|
Target Port in containers for traffic from ingress
|
|
traffic
|
TrafficWeight[]
|
|
Traffic weights for app's revisions
|
|
transport
|
IngressTransportMethod
|
auto
|
Ingress transport protocol
|
IngressClientCertificateMode
Enumeration
Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require a client certificate. Require indicates server requires a client certificate.
| Value |
Description |
|
ignore
|
ignore
|
|
accept
|
accept
|
|
require
|
require
|
IngressPortMapping
Object
Port mappings of container app ingress
| Name |
Type |
Description |
|
exposedPort
|
integer
(int32)
|
Specifies the exposed port for the target port. If not specified, it defaults to target port
|
|
external
|
boolean
|
Specifies whether the app port is accessible outside of the environment
|
|
targetPort
|
integer
(int32)
|
Specifies the port user's container listens on
|
IngressStickySessions
Object
Sticky Sessions for Single Revision Mode
| Name |
Type |
Description |
|
affinity
|
Affinity
|
Sticky Session Affinity
|
IngressTransportMethod
Enumeration
Ingress transport protocol
| Value |
Description |
|
auto
|
auto
|
|
http
|
http
|
|
http2
|
http2
|
|
tcp
|
tcp
|
InitContainer
Object
Container App init container definition
| Name |
Type |
Description |
|
args
|
string[]
|
Container start command arguments.
|
|
command
|
string[]
|
Container start command.
|
|
env
|
EnvironmentVar[]
|
Container environment variables.
|
|
image
|
string
|
Container image tag.
|
|
name
|
string
|
Custom container name.
|
|
resources
|
ContainerResources
|
Container resource requirements.
|
|
volumeMounts
|
VolumeMount[]
|
Container volume mounts.
|
IpSecurityRestrictionRule
Object
Rule to restrict incoming IP address.
| Name |
Type |
Description |
|
action
|
Action
|
Allow or Deny rules to determine for incoming IP. Note: Rules can only consist of ALL Allow or ALL Deny
|
|
description
|
string
|
Describe the IP restriction rule that is being sent to the container-app. This is an optional field.
|
|
ipAddressRange
|
string
|
CIDR notation to match incoming IP address
|
|
name
|
string
|
Name for the IP restriction rule.
|
Kind
Enumeration
Metadata to represent the container app kind, representing if a container app is workflowapp or functionapp.
| Value |
Description |
|
workflowapp
|
workflowapp
|
|
functionapp
|
functionapp
|
LogLevel
Enumeration
Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info.
| Value |
Description |
|
info
|
info
|
|
debug
|
debug
|
|
warn
|
warn
|
|
error
|
error
|
ManagedServiceIdentity
Object
Managed service identity (system assigned and/or user assigned identities)
| Name |
Type |
Description |
|
principalId
|
string
(uuid)
|
The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.
|
|
tenantId
|
string
(uuid)
|
The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
|
|
type
|
ManagedServiceIdentityType
|
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
User-Assigned Identities
The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.
|
ManagedServiceIdentityType
Enumeration
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
| Value |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
QueueScaleRule
Object
Container App container Azure Queue based scaling rule.
| Name |
Type |
Description |
|
accountName
|
string
|
Storage account name. required if using managed identity to authenticate
|
|
auth
|
ScaleRuleAuth[]
|
Authentication secrets for the queue scale rule.
|
|
identity
|
string
|
The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity.
|
|
queueLength
|
integer
(int32)
|
Queue length.
|
|
queueName
|
string
|
Queue name.
|
RegistryCredentials
Object
Container App Private Registry
| Name |
Type |
Description |
|
identity
|
string
|
A Managed Identity to use to authenticate with Azure Container Registry. For user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned identities, use 'system'
|
|
passwordSecretRef
|
string
|
The name of the Secret that contains the registry login password
|
|
server
|
string
|
Container Registry Server
|
|
username
|
string
|
Container Registry Username
|
Runtime
Object
Container App Runtime configuration.
| Name |
Type |
Description |
|
java
|
RuntimeJava
|
Java app configuration
|
RuntimeJava
Object
Java app configuration
| Name |
Type |
Description |
|
enableMetrics
|
boolean
|
Enable jmx core metrics for the java app
|
Scale
Object
Container App scaling configurations.
| Name |
Type |
Default value |
Description |
|
allowScalingRuleOverride
|
boolean
|
|
Optional. Whether custom scale rules can override the automatic scale rules. This property is only applicable to Function Apps.
|
|
cooldownPeriod
|
integer
(int32)
|
|
Optional. KEDA Cooldown Period in seconds. Defaults to 300 seconds if not set.
|
|
maxReplicas
|
integer
(int32)
|
10
|
Optional. Maximum number of container replicas. Defaults to 10 if not set.
|
|
minReplicas
|
integer
(int32)
|
|
Optional. Minimum number of container replicas.
|
|
pollingInterval
|
integer
(int32)
|
|
Optional. KEDA Polling Interval in seconds. Defaults to 30 seconds if not set.
|
|
rules
|
ScaleRule[]
|
|
Scaling rules.
|
ScaleRule
Object
Container App container scaling rule.
ScaleRuleAuth
Object
Auth Secrets for Scale Rule
| Name |
Type |
Description |
|
secretRef
|
string
|
Name of the secret from which to pull the auth params.
|
|
triggerParameter
|
string
|
Trigger Parameter that uses the secret
|
Scheme
Enumeration
Scheme to use for connecting to the host. Defaults to HTTP.
| Value |
Description |
|
HTTP
|
HTTP
|
|
HTTPS
|
HTTPS
|
Secret
Object
Secret definition.
| Name |
Type |
Description |
|
identity
|
string
|
Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity.
|
|
keyVaultUrl
|
string
|
Azure Key Vault URL pointing to the secret referenced by the container app.
|
|
name
|
string
|
Secret Name.
|
|
value
|
string
(password)
|
Secret Value.
|
SecretVolumeItem
Object
Secret to be added to volume.
| Name |
Type |
Description |
|
path
|
string
|
Path to project secret to. If no path is provided, path defaults to name of secret listed in secretRef.
|
|
secretRef
|
string
|
Name of the Container App secret from which to pull the secret value.
|
Service
Object
Container App to be a dev service
| Name |
Type |
Description |
|
type
|
string
|
Dev ContainerApp service type
|
ServiceBind
Object
Configuration to bind a ContainerApp to a dev ContainerApp Service
| Name |
Type |
Description |
|
name
|
string
|
Name of the service bind
|
|
serviceId
|
string
|
Resource id of the target service
|
StorageType
Enumeration
Storage type for the volume. If not provided, use EmptyDir.
| Value |
Description |
|
AzureFile
|
AzureFile
|
|
EmptyDir
|
EmptyDir
|
|
Secret
|
Secret
|
|
NfsAzureFile
|
NfsAzureFile
|
systemData
Object
Metadata pertaining to creation and last modification of the resource.
| Name |
Type |
Description |
|
createdAt
|
string
(date-time)
|
The timestamp of resource creation (UTC).
|
|
createdBy
|
string
|
The identity that created the resource.
|
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
|
lastModifiedAt
|
string
(date-time)
|
The timestamp of resource last modification (UTC)
|
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|
TcpScaleRule
Object
Container App container Tcp scaling rule.
| Name |
Type |
Description |
|
auth
|
ScaleRuleAuth[]
|
Authentication secrets for the tcp scale rule.
|
|
identity
|
string
|
The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity.
|
|
metadata
|
object
|
Metadata properties to describe tcp scale rule.
|
Template
Object
Container App versioned application definition.
Defines the desired state of an immutable revision.
Any changes to this section Will result in a new revision being created
| Name |
Type |
Description |
|
containers
|
Container[]
|
List of container definitions for the Container App.
|
|
initContainers
|
InitContainer[]
|
List of specialized containers that run before app containers.
|
|
revisionSuffix
|
string
|
User friendly suffix that is appended to the revision name
|
|
scale
|
Scale
|
Scaling properties for the Container App.
|
|
serviceBinds
|
ServiceBind[]
|
List of container app services bound to the app
|
|
terminationGracePeriodSeconds
|
integer
(int64)
|
Optional duration in seconds the Container App Instance needs to terminate gracefully. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.
|
|
volumes
|
Volume[]
|
List of volume definitions for the Container App.
|
TrafficWeight
Object
Traffic weight assigned to a revision
| Name |
Type |
Default value |
Description |
|
label
|
string
|
|
Associates a traffic label with a revision
|
|
latestRevision
|
boolean
|
False
|
Indicates that the traffic weight belongs to a latest stable revision
|
|
revisionName
|
string
|
|
Name of a revision
|
|
weight
|
integer
(int32)
|
|
Traffic weight assigned to a revision
|
Type
Enumeration
The type of probe.
| Value |
Description |
|
Liveness
|
Liveness
|
|
Readiness
|
Readiness
|
|
Startup
|
Startup
|
UserAssignedIdentity
Object
User assigned identity properties
| Name |
Type |
Description |
|
clientId
|
string
(uuid)
|
The client ID of the assigned identity.
|
|
principalId
|
string
(uuid)
|
The principal ID of the assigned identity.
|
Volume
Object
Volume definitions for the Container App.
| Name |
Type |
Description |
|
mountOptions
|
string
|
Mount options used while mounting the Azure file share or NFS Azure file share. Must be a comma-separated string.
|
|
name
|
string
|
Volume name.
|
|
secrets
|
SecretVolumeItem[]
|
List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume.
|
|
storageName
|
string
|
Name of storage resource. No need to provide for EmptyDir and Secret.
|
|
storageType
|
StorageType
|
Storage type for the volume. If not provided, use EmptyDir.
|
VolumeMount
Object
Volume mount for the Container App.
| Name |
Type |
Description |
|
mountPath
|
string
|
Path within the container at which the volume should be mounted.Must not contain ':'.
|
|
subPath
|
string
|
Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root).
|
|
volumeName
|
string
|
This must match the Name of a Volume.
|