Erstellen oder aktualisieren Sie einen Sitzungspool mit den angegebenen Eigenschaften.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}?api-version=2025-07-01
URI-Parameter
| Name |
In |
Erforderlich |
Typ |
Beschreibung |
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Der Name der Ressourcengruppe. Bei dem Namen wird die Groß-/Kleinschreibung nicht beachtet.
|
|
sessionPoolName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-z][a-z0-9]*$
|
Name des Sitzungspools.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Die ID des Zielabonnements. Der Wert muss eine UUID sein.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Hierbei handelt es sich um die für diesen Vorgang zu verwendende API-Version.
|
Anforderungstext
| Name |
Erforderlich |
Typ |
Beschreibung |
|
location
|
True
|
string
|
Der geografische Standort, an dem sich die Ressource befindet
|
|
identity
|
|
ManagedServiceIdentity
|
Verwaltete Identitäten, die von einem Sitzungspool benötigt werden, um mit anderen Azure-Diensten zu interagieren, um keine geheimen Schlüssel oder Anmeldeinformationen im Code zu verwalten.
|
|
properties.containerType
|
|
ContainerType
|
Der Containertyp der Sitzungen.
|
|
properties.customContainerTemplate
|
|
CustomContainerTemplate
|
Die benutzerdefinierte Containerkonfiguration, wenn der containerType customContainer ist.
|
|
properties.dynamicPoolConfiguration
|
|
DynamicPoolConfiguration
|
Die Poolkonfiguration, wenn der poolManagementType dynamisch ist.
|
|
properties.environmentId
|
|
string
(arm-id)
|
Ressourcen-ID der Umgebung des Sitzungspools.
|
|
properties.managedIdentitySettings
|
|
ManagedIdentitySetting[]
|
Optionale Einstellungen für eine verwaltete Identität, die dem Sitzungspool zugewiesen ist.
|
|
properties.poolManagementType
|
|
PoolManagementType
|
Der Poolverwaltungstyp des Sitzungspools.
|
|
properties.scaleConfiguration
|
|
ScaleConfiguration
|
Die Skalierungskonfiguration des Sitzungspools.
|
|
properties.secrets
|
|
SessionPoolSecret[]
|
Die geheimen Schlüssel des Sitzungspools.
|
|
properties.sessionNetworkConfiguration
|
|
SessionNetworkConfiguration
|
Die Netzwerkkonfiguration der Sitzungen im Sitzungspool.
|
|
tags
|
|
object
|
Ressourcentags.
|
Antworten
| Name |
Typ |
Beschreibung |
|
200 OK
|
SessionPool
|
Update erfolgreich
|
|
201 Created
|
SessionPool
|
Die Erstellung des Sitzungspools hat begonnen.
|
|
Other Status Codes
|
ErrorResponse
|
Häufige Fehlerantwort.
|
Sicherheit
azure_auth
Azure Active Directory OAuth2-Fluss.
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
| Name |
Beschreibung |
|
user_impersonation
|
Identitätswechsel ihres Benutzerkontos
|
Beispiele
Create or Update Session Pool with lifecycle OnContainerExit Timed
Beispielanforderung
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool?api-version=2025-07-01
{
"location": "East US",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"poolManagementType": "Dynamic",
"containerType": "CustomContainer",
"scaleConfiguration": {
"maxConcurrentSessions": 500,
"readySessionInstances": 100
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {
"lifecycleType": "OnContainerExit",
"maxAlivePeriodInSeconds": 86400
}
},
"customContainerTemplate": {
"containers": [
{
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
},
"command": [
"/bin/sh"
],
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
]
}
],
"ingress": {
"targetPort": 80
},
"registryCredentials": {
"server": "test.azurecr.io",
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"
}
},
"sessionNetworkConfiguration": {
"status": "EgressEnabled"
},
"managedIdentitySettings": [
{
"identity": "system",
"lifecycle": "Main"
}
]
}
}
import com.azure.resourcemanager.appcontainers.models.ContainerType;
import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate;
import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration;
import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle;
import com.azure.resourcemanager.appcontainers.models.LifecycleConfiguration;
import com.azure.resourcemanager.appcontainers.models.LifecycleType;
import com.azure.resourcemanager.appcontainers.models.ManagedIdentitySetting;
import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity;
import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.appcontainers.models.PoolManagementType;
import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration;
import com.azure.resourcemanager.appcontainers.models.SessionContainer;
import com.azure.resourcemanager.appcontainers.models.SessionContainerResources;
import com.azure.resourcemanager.appcontainers.models.SessionIngress;
import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration;
import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus;
import com.azure.resourcemanager.appcontainers.models.SessionRegistryCredentials;
import java.util.Arrays;
/**
* Samples for ContainerAppsSessionPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/
* SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update Session Pool with lifecycle OnContainerExit Timed.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void createOrUpdateSessionPoolWithLifecycleOnContainerExitTimed(
com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerAppsSessionPools().define("testsessionpool").withRegion("East US")
.withExistingResourceGroup("rg")
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED))
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.withContainerType(ContainerType.CUSTOM_CONTAINER).withPoolManagementType(PoolManagementType.DYNAMIC)
.withScaleConfiguration(
new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100))
.withDynamicPoolConfiguration(
new DynamicPoolConfiguration().withLifecycleConfiguration(new LifecycleConfiguration()
.withLifecycleType(LifecycleType.ON_CONTAINER_EXIT).withMaxAlivePeriodInSeconds(86400)))
.withCustomContainerTemplate(new CustomContainerTemplate()
.withRegistryCredentials(new SessionRegistryCredentials().withServer("test.azurecr.io").withIdentity(
"/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"))
.withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4")
.withName("testinitcontainer").withCommand(Arrays.asList("/bin/sh"))
.withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done"))
.withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi"))))
.withIngress(new SessionIngress().withTargetPort(80)))
.withSessionNetworkConfiguration(
new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED))
.withManagedIdentitySettings(Arrays.asList(
new ManagedIdentitySetting().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.MAIN)))
.create();
}
}
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 session_pools_lifecycle_on_container_exit_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="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
)
response = client.container_apps_session_pools.begin_create_or_update(
resource_group_name="rg",
session_pool_name="testsessionpool",
session_pool_envelope={
"identity": {"type": "SystemAssigned"},
"location": "East US",
"properties": {
"containerType": "CustomContainer",
"customContainerTemplate": {
"containers": [
{
"args": ["-c", "while true; do echo hello; sleep 10;done"],
"command": ["/bin/sh"],
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {"cpu": 0.25, "memory": "0.5Gi"},
}
],
"ingress": {"targetPort": 80},
"registryCredentials": {
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP",
"server": "test.azurecr.io",
},
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {"lifecycleType": "OnContainerExit", "maxAlivePeriodInSeconds": 86400}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"managedIdentitySettings": [{"identity": "system", "lifecycle": "Main"}],
"poolManagementType": "Dynamic",
"scaleConfiguration": {"maxConcurrentSessions": 500, "readySessionInstances": 100},
"sessionNetworkConfiguration": {"status": "EgressEnabled"},
},
},
).result()
print(response)
# x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_LifecycleOnContainerExit_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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b2965096067d6f8374b5485b0568fd36e7c9d099/specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json
func ExampleContainerAppsSessionPoolsClient_BeginCreateOrUpdate_createOrUpdateSessionPoolWithLifecycleOnContainerExitTimed() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsSessionPoolsClient().BeginCreateOrUpdate(ctx, "rg", "testsessionpool", armappcontainers.SessionPool{
Location: to.Ptr("East US"),
Identity: &armappcontainers.ManagedServiceIdentity{
Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssigned),
},
Properties: &armappcontainers.SessionPoolProperties{
ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer),
CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{
Containers: []*armappcontainers.SessionContainer{
{
Name: to.Ptr("testinitcontainer"),
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/testcontainer:v4"),
Resources: &armappcontainers.SessionContainerResources{
CPU: to.Ptr[float64](0.25),
Memory: to.Ptr("0.5Gi"),
},
}},
Ingress: &armappcontainers.SessionIngress{
TargetPort: to.Ptr[int32](80),
},
RegistryCredentials: &armappcontainers.SessionRegistryCredentials{
Identity: to.Ptr("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"),
Server: to.Ptr("test.azurecr.io"),
},
},
DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{
LifecycleConfiguration: &armappcontainers.LifecycleConfiguration{
LifecycleType: to.Ptr(armappcontainers.LifecycleTypeOnContainerExit),
MaxAlivePeriodInSeconds: to.Ptr[int32](86400),
},
},
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
ManagedIdentitySettings: []*armappcontainers.ManagedIdentitySetting{
{
Identity: to.Ptr("system"),
Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleMain),
}},
PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic),
ScaleConfiguration: &armappcontainers.ScaleConfiguration{
MaxConcurrentSessions: to.Ptr[int32](500),
ReadySessionInstances: to.Ptr[int32](100),
},
SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{
Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled),
},
},
}, 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 pull 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.SessionPool = armappcontainers.SessionPool{
// Name: to.Ptr("testsessionpool"),
// Type: to.Ptr("Microsoft.App/sessionPools"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"),
// Location: to.Ptr("East US"),
// Identity: &armappcontainers.ManagedServiceIdentity{
// Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("bce8c037-3d10-44a4-a970-25f799611fc6"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Properties: &armappcontainers.SessionPoolProperties{
// ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer),
// CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{
// Containers: []*armappcontainers.SessionContainer{
// {
// Name: to.Ptr("testinitcontainer"),
// 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/testcontainer:v4"),
// Resources: &armappcontainers.SessionContainerResources{
// CPU: to.Ptr[float64](0.25),
// Memory: to.Ptr("0.5Gi"),
// },
// }},
// Ingress: &armappcontainers.SessionIngress{
// TargetPort: to.Ptr[int32](80),
// },
// RegistryCredentials: &armappcontainers.SessionRegistryCredentials{
// Identity: to.Ptr("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"),
// Server: to.Ptr("test.azurecr.io"),
// },
// },
// DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{
// LifecycleConfiguration: &armappcontainers.LifecycleConfiguration{
// LifecycleType: to.Ptr(armappcontainers.LifecycleTypeOnContainerExit),
// MaxAlivePeriodInSeconds: to.Ptr[int32](86400),
// },
// },
// EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
// NodeCount: to.Ptr[int32](1),
// PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"),
// PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic),
// ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded),
// ScaleConfiguration: &armappcontainers.ScaleConfiguration{
// MaxConcurrentSessions: to.Ptr[int32](500),
// ReadySessionInstances: to.Ptr[int32](100),
// },
// SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{
// Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.AppContainers.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.AppContainers;
// Generated from example definition: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json
// this example is just showing the usage of "ContainerAppsSessionPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
string resourceGroupName = "rg";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SessionPoolResource
SessionPoolCollection collection = resourceGroupResource.GetSessionPools();
// invoke the operation
string sessionPoolName = "testsessionpool";
SessionPoolData data = new SessionPoolData(new AzureLocation("East US"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
EnvironmentId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
ContainerType = ContainerType.CustomContainer,
PoolManagementType = PoolManagementType.Dynamic,
ScaleConfiguration = new SessionPoolScaleConfiguration
{
MaxConcurrentSessions = 500,
ReadySessionInstances = 100,
},
DynamicPoolLifecycleConfiguration = new SessionPoolLifecycleConfiguration
{
LifecycleType = SessionPoolLifecycleType.OnContainerExit,
MaxAlivePeriodInSeconds = 86400,
},
CustomContainerTemplate = new CustomContainerTemplate
{
RegistryCredentials = new SessionRegistryCredentials
{
Server = "test.azurecr.io",
Identity = "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP",
},
Containers = {new SessionContainer
{
Image = "repo/testcontainer:v4",
Name = "testinitcontainer",
Command = {"/bin/sh"},
Args = {"-c", "while true; do echo hello; sleep 10;done"},
Resources = new SessionContainerResources
{
Cpu = 0.25,
Memory = "0.5Gi",
},
}},
IngressTargetPort = 80,
},
SessionNetworkStatus = SessionNetworkStatus.EgressEnabled,
ManagedIdentitySettings = {new SessionPoolManagedIdentitySetting("system")
{
Lifecycle = ContainerAppIdentitySettingsLifeCycle.Main,
}},
};
ArmOperation<SessionPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sessionPoolName, data);
SessionPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SessionPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool",
"name": "testsessionpool",
"type": "Microsoft.App/sessionPools",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"poolManagementType": "Dynamic",
"nodeCount": 1,
"containerType": "CustomContainer",
"scaleConfiguration": {
"maxConcurrentSessions": 500,
"readySessionInstances": 100
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {
"lifecycleType": "OnContainerExit",
"maxAlivePeriodInSeconds": 86400
}
},
"customContainerTemplate": {
"containers": [
{
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
},
"command": [
"/bin/sh"
],
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
]
}
],
"ingress": {
"targetPort": 80
},
"registryCredentials": {
"server": "test.azurecr.io",
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"
}
},
"sessionNetworkConfiguration": {
"status": "EgressEnabled"
},
"poolManagementEndpoint": "https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"
},
"identity": {
"type": "SystemAssigned",
"principalId": "bce8c037-3d10-44a4-a970-25f799611fc6",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool",
"name": "testsessionpool",
"type": "Microsoft.App/sessionPools",
"location": "East US",
"properties": {
"provisioningState": "InProgress",
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"poolManagementType": "Dynamic",
"containerType": "CustomContainer",
"scaleConfiguration": {
"maxConcurrentSessions": 500,
"readySessionInstances": 100
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {
"lifecycleType": "OnContainerExit",
"maxAlivePeriodInSeconds": 86400
}
},
"customContainerTemplate": {
"containers": [
{
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
},
"command": [
"/bin/sh"
],
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
]
}
],
"ingress": {
"targetPort": 80
},
"registryCredentials": {
"server": "test.azurecr.io",
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"
}
},
"sessionNetworkConfiguration": {
"status": "EgressEnabled"
},
"poolManagementEndpoint": "https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io",
"managedIdentitySettings": [
{
"identity": "system",
"lifecycle": "Main"
}
]
},
"identity": {
"type": "SystemAssigned",
"principalId": "bce8c037-3d10-44a4-a970-25f799611fc6",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
Create or Update Session Pool with lifecycle type Timed
Beispielanforderung
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool?api-version=2025-07-01
{
"location": "East US",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"poolManagementType": "Dynamic",
"containerType": "CustomContainer",
"scaleConfiguration": {
"maxConcurrentSessions": 500,
"readySessionInstances": 100
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {
"lifecycleType": "OnContainerExit",
"maxAlivePeriodInSeconds": 86400
}
},
"customContainerTemplate": {
"containers": [
{
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
},
"command": [
"/bin/sh"
],
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
]
}
],
"ingress": {
"targetPort": 80
},
"registryCredentials": {
"server": "test.azurecr.io",
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"
}
},
"sessionNetworkConfiguration": {
"status": "EgressEnabled"
},
"managedIdentitySettings": [
{
"identity": "system",
"lifecycle": "Main"
}
]
}
}
import com.azure.resourcemanager.appcontainers.models.ContainerType;
import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate;
import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration;
import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle;
import com.azure.resourcemanager.appcontainers.models.LifecycleConfiguration;
import com.azure.resourcemanager.appcontainers.models.LifecycleType;
import com.azure.resourcemanager.appcontainers.models.ManagedIdentitySetting;
import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity;
import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.appcontainers.models.PoolManagementType;
import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration;
import com.azure.resourcemanager.appcontainers.models.SessionContainer;
import com.azure.resourcemanager.appcontainers.models.SessionContainerResources;
import com.azure.resourcemanager.appcontainers.models.SessionIngress;
import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration;
import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus;
import com.azure.resourcemanager.appcontainers.models.SessionRegistryCredentials;
import java.util.Arrays;
/**
* Samples for ContainerAppsSessionPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/
* SessionPools_LifecycleTimed_CreateOrUpdate.json
*/
/**
* Sample code: Create or Update Session Pool with lifecycle type Timed.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void createOrUpdateSessionPoolWithLifecycleTypeTimed(
com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.containerAppsSessionPools().define("testsessionpool").withRegion("East US")
.withExistingResourceGroup("rg")
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED))
.withEnvironmentId(
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.withContainerType(ContainerType.CUSTOM_CONTAINER).withPoolManagementType(PoolManagementType.DYNAMIC)
.withScaleConfiguration(
new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100))
.withDynamicPoolConfiguration(
new DynamicPoolConfiguration().withLifecycleConfiguration(new LifecycleConfiguration()
.withLifecycleType(LifecycleType.ON_CONTAINER_EXIT).withMaxAlivePeriodInSeconds(86400)))
.withCustomContainerTemplate(new CustomContainerTemplate()
.withRegistryCredentials(new SessionRegistryCredentials().withServer("test.azurecr.io").withIdentity(
"/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"))
.withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4")
.withName("testinitcontainer").withCommand(Arrays.asList("/bin/sh"))
.withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done"))
.withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi"))))
.withIngress(new SessionIngress().withTargetPort(80)))
.withSessionNetworkConfiguration(
new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED))
.withManagedIdentitySettings(Arrays.asList(
new ManagedIdentitySetting().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.MAIN)))
.create();
}
}
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 session_pools_lifecycle_timed_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="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
)
response = client.container_apps_session_pools.begin_create_or_update(
resource_group_name="rg",
session_pool_name="testsessionpool",
session_pool_envelope={
"identity": {"type": "SystemAssigned"},
"location": "East US",
"properties": {
"containerType": "CustomContainer",
"customContainerTemplate": {
"containers": [
{
"args": ["-c", "while true; do echo hello; sleep 10;done"],
"command": ["/bin/sh"],
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {"cpu": 0.25, "memory": "0.5Gi"},
}
],
"ingress": {"targetPort": 80},
"registryCredentials": {
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP",
"server": "test.azurecr.io",
},
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {"lifecycleType": "OnContainerExit", "maxAlivePeriodInSeconds": 86400}
},
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"managedIdentitySettings": [{"identity": "system", "lifecycle": "Main"}],
"poolManagementType": "Dynamic",
"scaleConfiguration": {"maxConcurrentSessions": 500, "readySessionInstances": 100},
"sessionNetworkConfiguration": {"status": "EgressEnabled"},
},
},
).result()
print(response)
# x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_LifecycleTimed_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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b2965096067d6f8374b5485b0568fd36e7c9d099/specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_LifecycleTimed_CreateOrUpdate.json
func ExampleContainerAppsSessionPoolsClient_BeginCreateOrUpdate_createOrUpdateSessionPoolWithLifecycleTypeTimed() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerAppsSessionPoolsClient().BeginCreateOrUpdate(ctx, "rg", "testsessionpool", armappcontainers.SessionPool{
Location: to.Ptr("East US"),
Identity: &armappcontainers.ManagedServiceIdentity{
Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssigned),
},
Properties: &armappcontainers.SessionPoolProperties{
ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer),
CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{
Containers: []*armappcontainers.SessionContainer{
{
Name: to.Ptr("testinitcontainer"),
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/testcontainer:v4"),
Resources: &armappcontainers.SessionContainerResources{
CPU: to.Ptr[float64](0.25),
Memory: to.Ptr("0.5Gi"),
},
}},
Ingress: &armappcontainers.SessionIngress{
TargetPort: to.Ptr[int32](80),
},
RegistryCredentials: &armappcontainers.SessionRegistryCredentials{
Identity: to.Ptr("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"),
Server: to.Ptr("test.azurecr.io"),
},
},
DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{
LifecycleConfiguration: &armappcontainers.LifecycleConfiguration{
LifecycleType: to.Ptr(armappcontainers.LifecycleTypeOnContainerExit),
MaxAlivePeriodInSeconds: to.Ptr[int32](86400),
},
},
EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
ManagedIdentitySettings: []*armappcontainers.ManagedIdentitySetting{
{
Identity: to.Ptr("system"),
Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleMain),
}},
PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic),
ScaleConfiguration: &armappcontainers.ScaleConfiguration{
MaxConcurrentSessions: to.Ptr[int32](500),
ReadySessionInstances: to.Ptr[int32](100),
},
SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{
Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled),
},
},
}, 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 pull 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.SessionPool = armappcontainers.SessionPool{
// Name: to.Ptr("testsessionpool"),
// Type: to.Ptr("Microsoft.App/sessionPools"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"),
// Location: to.Ptr("East US"),
// Identity: &armappcontainers.ManagedServiceIdentity{
// Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("bce8c037-3d10-44a4-a970-25f799611fc6"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Properties: &armappcontainers.SessionPoolProperties{
// ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer),
// CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{
// Containers: []*armappcontainers.SessionContainer{
// {
// Name: to.Ptr("testinitcontainer"),
// 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/testcontainer:v4"),
// Resources: &armappcontainers.SessionContainerResources{
// CPU: to.Ptr[float64](0.25),
// Memory: to.Ptr("0.5Gi"),
// },
// }},
// Ingress: &armappcontainers.SessionIngress{
// TargetPort: to.Ptr[int32](80),
// },
// RegistryCredentials: &armappcontainers.SessionRegistryCredentials{
// Identity: to.Ptr("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"),
// Server: to.Ptr("test.azurecr.io"),
// },
// },
// DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{
// LifecycleConfiguration: &armappcontainers.LifecycleConfiguration{
// LifecycleType: to.Ptr(armappcontainers.LifecycleTypeTimed),
// MaxAlivePeriodInSeconds: to.Ptr[int32](600),
// },
// },
// EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
// NodeCount: to.Ptr[int32](1),
// PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"),
// PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic),
// ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded),
// ScaleConfiguration: &armappcontainers.ScaleConfiguration{
// MaxConcurrentSessions: to.Ptr[int32](500),
// ReadySessionInstances: to.Ptr[int32](100),
// },
// SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{
// Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.AppContainers.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.AppContainers;
// Generated from example definition: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_LifecycleTimed_CreateOrUpdate.json
// this example is just showing the usage of "ContainerAppsSessionPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
string resourceGroupName = "rg";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SessionPoolResource
SessionPoolCollection collection = resourceGroupResource.GetSessionPools();
// invoke the operation
string sessionPoolName = "testsessionpool";
SessionPoolData data = new SessionPoolData(new AzureLocation("East US"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
EnvironmentId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
ContainerType = ContainerType.CustomContainer,
PoolManagementType = PoolManagementType.Dynamic,
ScaleConfiguration = new SessionPoolScaleConfiguration
{
MaxConcurrentSessions = 500,
ReadySessionInstances = 100,
},
DynamicPoolLifecycleConfiguration = new SessionPoolLifecycleConfiguration
{
LifecycleType = SessionPoolLifecycleType.OnContainerExit,
MaxAlivePeriodInSeconds = 86400,
},
CustomContainerTemplate = new CustomContainerTemplate
{
RegistryCredentials = new SessionRegistryCredentials
{
Server = "test.azurecr.io",
Identity = "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP",
},
Containers = {new SessionContainer
{
Image = "repo/testcontainer:v4",
Name = "testinitcontainer",
Command = {"/bin/sh"},
Args = {"-c", "while true; do echo hello; sleep 10;done"},
Resources = new SessionContainerResources
{
Cpu = 0.25,
Memory = "0.5Gi",
},
}},
IngressTargetPort = 80,
},
SessionNetworkStatus = SessionNetworkStatus.EgressEnabled,
ManagedIdentitySettings = {new SessionPoolManagedIdentitySetting("system")
{
Lifecycle = ContainerAppIdentitySettingsLifeCycle.Main,
}},
};
ArmOperation<SessionPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sessionPoolName, data);
SessionPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SessionPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool",
"name": "testsessionpool",
"type": "Microsoft.App/sessionPools",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"poolManagementType": "Dynamic",
"nodeCount": 1,
"containerType": "CustomContainer",
"scaleConfiguration": {
"maxConcurrentSessions": 500,
"readySessionInstances": 100
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {
"lifecycleType": "Timed",
"maxAlivePeriodInSeconds": 600
}
},
"customContainerTemplate": {
"containers": [
{
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
},
"command": [
"/bin/sh"
],
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
]
}
],
"ingress": {
"targetPort": 80
},
"registryCredentials": {
"server": "test.azurecr.io",
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"
}
},
"sessionNetworkConfiguration": {
"status": "EgressEnabled"
},
"poolManagementEndpoint": "https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"
},
"identity": {
"type": "SystemAssigned",
"principalId": "bce8c037-3d10-44a4-a970-25f799611fc6",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool",
"name": "testsessionpool",
"type": "Microsoft.App/sessionPools",
"location": "East US",
"properties": {
"provisioningState": "InProgress",
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
"poolManagementType": "Dynamic",
"containerType": "CustomContainer",
"scaleConfiguration": {
"maxConcurrentSessions": 500,
"readySessionInstances": 100
},
"dynamicPoolConfiguration": {
"lifecycleConfiguration": {
"lifecycleType": "Timed",
"maxAlivePeriodInSeconds": 600
}
},
"customContainerTemplate": {
"containers": [
{
"image": "repo/testcontainer:v4",
"name": "testinitcontainer",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
},
"command": [
"/bin/sh"
],
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
]
}
],
"ingress": {
"targetPort": 80
},
"registryCredentials": {
"server": "test.azurecr.io",
"identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"
}
},
"sessionNetworkConfiguration": {
"status": "EgressEnabled"
},
"poolManagementEndpoint": "https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io",
"managedIdentitySettings": [
{
"identity": "system",
"lifecycle": "Main"
}
]
},
"identity": {
"type": "SystemAssigned",
"principalId": "bce8c037-3d10-44a4-a970-25f799611fc6",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
Definitionen
ContainerType
Enumeration
Der Containertyp der Sitzungen.
| Wert |
Beschreibung |
|
CustomContainer
|
|
|
PythonLTS
|
|
createdByType
Enumeration
Der Identitätstyp, der die Ressource erstellt hat.
| Wert |
Beschreibung |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
CustomContainerTemplate
Objekt
Benutzerdefinierte Containerkonfiguration.
| Name |
Typ |
Beschreibung |
|
containers
|
SessionContainer[]
|
Liste der Containerdefinitionen für die Sitzungen des Sitzungspools.
|
|
ingress
|
SessionIngress
|
Konfiguration des Sitzungspools.
|
|
registryCredentials
|
SessionRegistryCredentials
|
Anmeldeinformationen für private Container für Container, die von den Sitzungen des Sitzungspools verwendet werden.
|
DynamicPoolConfiguration
Objekt
Konfiguration des dynamischen Pools.
| Name |
Typ |
Beschreibung |
|
lifecycleConfiguration
|
LifecycleConfiguration
|
Die Lebenszykluskonfiguration einer Sitzung im dynamischen Sitzungspool
|
EnvironmentVar
Objekt
Container-App-Umgebungsvariable.
| Name |
Typ |
Beschreibung |
|
name
|
string
|
Name der Umgebungsvariable.
|
|
secretRef
|
string
|
Name des geheimen Container-App-Schlüssels, aus dem der Umgebungsvariablenwert abgerufen werden soll.
|
|
value
|
string
|
Nicht geheimer Umgebungsvariablenwert.
|
ErrorAdditionalInfo
Objekt
Der Ressourcenverwaltungsfehler zusätzliche Informationen.
| Name |
Typ |
Beschreibung |
|
info
|
object
|
Die zusätzlichen Informationen.
|
|
type
|
string
|
Der zusätzliche Informationstyp.
|
ErrorDetail
Objekt
Das Fehlerdetails.
| Name |
Typ |
Beschreibung |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Die zusätzlichen Informationen des Fehlers.
|
|
code
|
string
|
Der Fehlercode.
|
|
details
|
ErrorDetail[]
|
Die Fehlerdetails.
|
|
message
|
string
|
Die Fehlermeldung.
|
|
target
|
string
|
Das Fehlerziel.
|
ErrorResponse
Objekt
Fehlerantwort
| Name |
Typ |
Beschreibung |
|
error
|
ErrorDetail
|
Das Fehlerobjekt.
|
IdentitySettingsLifeCycle
Enumeration
Wird verwendet, um die Lebenszyklusphasen eines Sitzungspools auszuwählen, in dem die verwaltete Identität verfügbar sein sollte.
| Wert |
Beschreibung |
|
None
|
|
|
Main
|
|
LifecycleConfiguration
Objekt
Die Lebenszykluskonfigurationseigenschaften einer Sitzung im dynamischen Sitzungspool
| Name |
Typ |
Beschreibung |
|
cooldownPeriodInSeconds
|
integer
(int32)
|
Der Cooldownzeitraum einer Sitzung in Sekunden, wenn der Lebenszyklustyp "Timed" ist.
|
|
lifecycleType
|
LifecycleType
|
Der Lebenszyklustyp des Sitzungspools.
|
|
maxAlivePeriodInSeconds
|
integer
(int32)
|
Der maximale Lebendigkeitszeitraum einer Sitzung in Sekunden, wenn der Lebenszyklustyp "OnContainerExit" ist.
|
LifecycleType
Enumeration
Der Lebenszyklustyp des Sitzungspools.
| Wert |
Beschreibung |
|
Timed
|
|
|
OnContainerExit
|
|
ManagedIdentitySetting
Objekt
Optionale Einstellungen für eine verwaltete Identität, die dem Sitzungspool zugewiesen ist.
| Name |
Typ |
Standardwert |
Beschreibung |
|
identity
|
string
|
|
Die Ressourcen-ID einer vom Benutzer zugewiesenen verwalteten Identität, die dem Sitzungspool oder dem System für die vom System zugewiesene Identität zugewiesen ist.
|
|
lifecycle
|
IdentitySettingsLifeCycle
|
None
|
Wird verwendet, um die Lebenszyklusphasen eines Sitzungspools auszuwählen, in dem die verwaltete Identität verfügbar sein sollte.
|
ManagedServiceIdentity
Objekt
Verwaltete Dienstidentität (vom System zugewiesene und/oder vom Benutzer zugewiesene Identitäten)
| Name |
Typ |
Beschreibung |
|
principalId
|
string
(uuid)
|
Die Dienstprinzipal-ID der vom System zugewiesenen Identität. Diese Eigenschaft wird nur für eine vom System zugewiesene Identität bereitgestellt.
|
|
tenantId
|
string
(uuid)
|
Die Mandanten-ID der vom System zugewiesenen Identität. Diese Eigenschaft wird nur für eine vom System zugewiesene Identität bereitgestellt.
|
|
type
|
ManagedServiceIdentityType
|
Typ der verwalteten Dienstidentität (wobei systemAssigned- und UserAssigned-Typen zulässig sind).
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
User-Assigned Identitäten
Die Gruppe der benutzerzuweisungen Identitäten, die der Ressource zugeordnet sind. Die Wörterbuchschlüssel "userAssignedIdentities" sind ARM-Ressourcen-IDs im Formular: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. Die Wörterbuchwerte können leere Objekte ({}) in Anforderungen sein.
|
ManagedServiceIdentityType
Enumeration
Typ der verwalteten Dienstidentität (wobei systemAssigned- und UserAssigned-Typen zulässig sind).
| Wert |
Beschreibung |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
PoolManagementType
Enumeration
Der Poolverwaltungstyp des Sitzungspools.
| Wert |
Beschreibung |
|
Manual
|
|
|
Dynamic
|
|
ScaleConfiguration
Objekt
Skalierungskonfiguration.
| Name |
Typ |
Beschreibung |
|
maxConcurrentSessions
|
integer
(int32)
|
Die maximale Anzahl von Sitzungen gleichzeitig.
|
|
readySessionInstances
|
integer
(int32)
|
Die Mindestanzahl der bereiten Sitzungsinstanzen.
|
SessionContainer
Objekt
Containerdefinitionen für die Sitzungen des Sitzungspools.
| Name |
Typ |
Beschreibung |
|
args
|
string[]
|
Argumente für containerstartbefehle.
|
|
command
|
string[]
|
Containerstartbefehl.
|
|
env
|
EnvironmentVar[]
|
Containerumgebungsvariablen.
|
|
image
|
string
|
Containerimage-Tag.
|
|
name
|
string
|
Benutzerdefinierter Containername.
|
|
resources
|
SessionContainerResources
|
Containerressourcenanforderungen.
|
SessionContainerResources
Objekt
Containerressourcenanforderungen für Sitzungen des Sitzungspools.
| Name |
Typ |
Beschreibung |
|
cpu
|
number
(double)
|
Erforderliche CPU in Kernen, z. B. 0,5
|
|
memory
|
string
|
Erforderlicher Arbeitsspeicher, z. B. "250Mb"
|
SessionIngress
Objekt
Konfiguration des Sitzungspools.
| Name |
Typ |
Beschreibung |
|
targetPort
|
integer
(int32)
|
Zielport in Containern für Datenverkehr vom Ingress
|
SessionNetworkConfiguration
Objekt
Sitzungsnetzwerkkonfiguration.
SessionNetworkStatus
Enumeration
Netzwerkstatus für die Sitzungen.
| Wert |
Beschreibung |
|
EgressEnabled
|
|
|
EgressDisabled
|
|
SessionPool
Objekt
Container-App-Sitzungspool.
| Name |
Typ |
Beschreibung |
|
id
|
string
(arm-id)
|
Vollqualifizierte Ressourcen-ID für die Ressource. Z. B. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
ManagedServiceIdentity
|
Verwaltete Identitäten, die von einem Sitzungspool benötigt werden, um mit anderen Azure-Diensten zu interagieren, um keine geheimen Schlüssel oder Anmeldeinformationen im Code zu verwalten.
|
|
location
|
string
|
Der geografische Standort, an dem sich die Ressource befindet
|
|
name
|
string
|
Der Name der Ressource
|
|
properties.containerType
|
ContainerType
|
Der Containertyp der Sitzungen.
|
|
properties.customContainerTemplate
|
CustomContainerTemplate
|
Die benutzerdefinierte Containerkonfiguration, wenn der containerType customContainer ist.
|
|
properties.dynamicPoolConfiguration
|
DynamicPoolConfiguration
|
Die Poolkonfiguration, wenn der poolManagementType dynamisch ist.
|
|
properties.environmentId
|
string
(arm-id)
|
Ressourcen-ID der Umgebung des Sitzungspools.
|
|
properties.managedIdentitySettings
|
ManagedIdentitySetting[]
|
Optionale Einstellungen für eine verwaltete Identität, die dem Sitzungspool zugewiesen ist.
|
|
properties.nodeCount
|
integer
(int32)
|
Die Anzahl der Knoten, die der Sitzungspool verwendet.
|
|
properties.poolManagementEndpoint
|
string
(uri)
|
Der Endpunkt zum Verwalten des Pools.
|
|
properties.poolManagementType
|
PoolManagementType
|
Der Poolverwaltungstyp des Sitzungspools.
|
|
properties.provisioningState
|
SessionPoolProvisioningState
|
Bereitstellungsstatus des Sitzungspools.
|
|
properties.scaleConfiguration
|
ScaleConfiguration
|
Die Skalierungskonfiguration des Sitzungspools.
|
|
properties.secrets
|
SessionPoolSecret[]
|
Die geheimen Schlüssel des Sitzungspools.
|
|
properties.sessionNetworkConfiguration
|
SessionNetworkConfiguration
|
Die Netzwerkkonfiguration der Sitzungen im Sitzungspool.
|
|
systemData
|
systemData
|
Azure Resource Manager-Metadaten, die createdBy- und modifiedBy-Informationen enthalten.
|
|
tags
|
object
|
Ressourcentags.
|
|
type
|
string
|
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts"
|
SessionPoolProvisioningState
Enumeration
Bereitstellungsstatus des Sitzungspools.
| Wert |
Beschreibung |
|
InProgress
|
|
|
Succeeded
|
|
|
Failed
|
|
|
Canceled
|
|
|
Deleting
|
|
SessionPoolSecret
Objekt
Geheime Definition.
| Name |
Typ |
Beschreibung |
|
name
|
string
|
Geheimer Name.
|
|
value
|
string
|
Geheimer Wert.
|
SessionRegistryCredentials
Objekt
Private Registrierungsanmeldeinformationen für den Sitzungspool.
| Name |
Typ |
Beschreibung |
|
identity
|
string
|
Eine verwaltete Identität zur Authentifizierung bei Azure Container Registry. Verwenden Sie für vom Benutzer zugewiesene Identitäten die vollständige vom Benutzer zugewiesene Identitätsressourcen-ID. Verwenden Sie für vom System zugewiesene Identitäten "system"
|
|
passwordSecretRef
|
string
|
Der Name des geheimen Schlüssels, der das Registrierungsanmeldungskennwort enthält
|
|
server
|
string
|
Containerregistrierungsserver.
|
|
username
|
string
|
Benutzername der Containerregistrierung.
|
systemData
Objekt
Metadaten zur Erstellung und letzten Änderung der Ressource.
| Name |
Typ |
Beschreibung |
|
createdAt
|
string
(date-time)
|
Der Zeitstempel der Ressourcenerstellung (UTC).
|
|
createdBy
|
string
|
Die Identität, die die Ressource erstellt hat.
|
|
createdByType
|
createdByType
|
Der Identitätstyp, der die Ressource erstellt hat.
|
|
lastModifiedAt
|
string
(date-time)
|
Der Zeitstempel der letzten Änderung der Ressource (UTC)
|
|
lastModifiedBy
|
string
|
Die Identität, die die Ressource zuletzt geändert hat.
|
|
lastModifiedByType
|
createdByType
|
Der Identitätstyp, der die Ressource zuletzt geändert hat.
|
UserAssignedIdentity
Objekt
Benutzer zugewiesene Identitätseigenschaften
| Name |
Typ |
Beschreibung |
|
clientId
|
string
(uuid)
|
Die Client-ID der zugewiesenen Identität.
|
|
principalId
|
string
(uuid)
|
Die Prinzipal-ID der zugewiesenen Identität.
|