Creare o aggiornare un pool di sessioni con le proprietà specificate.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}?api-version=2025-07-01
Parametri dell'URI
| Nome |
In |
Necessario |
Tipo |
Descrizione |
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nome del gruppo di risorse. Il nome è insensibile alle maiuscole e minuscole.
|
|
sessionPoolName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-z][a-z0-9]*$
|
Nome del pool di sessioni.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
ID della sottoscrizione di destinazione. Il valore deve essere un UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Versione dell'API da usare per questa operazione.
|
Corpo della richiesta
| Nome |
Necessario |
Tipo |
Descrizione |
|
location
|
True
|
string
|
Posizione geografica in cui risiede la risorsa
|
|
identity
|
|
ManagedServiceIdentity
|
Identità gestite necessarie da un pool di sessioni per interagire con altri servizi di Azure per non mantenere segreti o credenziali nel codice.
|
|
properties.containerType
|
|
ContainerType
|
Tipo di contenitore delle sessioni.
|
|
properties.customContainerTemplate
|
|
CustomContainerTemplate
|
Configurazione del contenitore personalizzata se containerType è CustomContainer.
|
|
properties.dynamicPoolConfiguration
|
|
DynamicPoolConfiguration
|
Configurazione del pool se poolManagementType è dinamico.
|
|
properties.environmentId
|
|
string
(arm-id)
|
ID risorsa dell'ambiente del pool di sessioni.
|
|
properties.managedIdentitySettings
|
|
ManagedIdentitySetting[]
|
Impostazioni facoltative per un'identità gestita assegnata al pool di sessioni.
|
|
properties.poolManagementType
|
|
PoolManagementType
|
Tipo di gestione del pool di sessioni.
|
|
properties.scaleConfiguration
|
|
ScaleConfiguration
|
Configurazione della scalabilità del pool di sessioni.
|
|
properties.secrets
|
|
SessionPoolSecret[]
|
Segreti del pool di sessioni.
|
|
properties.sessionNetworkConfiguration
|
|
SessionNetworkConfiguration
|
Configurazione di rete delle sessioni nel pool di sessioni.
|
|
tags
|
|
object
|
Tag di risorsa.
|
Risposte
| Nome |
Tipo |
Descrizione |
|
200 OK
|
SessionPool
|
Aggiornamento riuscito
|
|
201 Created
|
SessionPool
|
La creazione del pool di sessioni è stata avviata.
|
|
Other Status Codes
|
ErrorResponse
|
Risposta di errore comune.
|
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory.
Tipo:
oauth2
Flow:
implicit
URL di autorizzazione:
https://login.microsoftonline.com/common/oauth2/authorize
Ambiti
| Nome |
Descrizione |
|
user_impersonation
|
rappresentare l'account utente
|
Esempio
Create or Update Session Pool with lifecycle OnContainerExit Timed
Esempio di richiesta
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
Risposta di esempio
{
"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
Esempio di richiesta
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
Risposta di esempio
{
"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"
}
}
Definizioni
ContainerType
Enumerazione
Tipo di contenitore delle sessioni.
| Valore |
Descrizione |
|
CustomContainer
|
|
|
PythonLTS
|
|
createdByType
Enumerazione
Tipo di identità che ha creato la risorsa.
| Valore |
Descrizione |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
CustomContainerTemplate
Object
Configurazione del contenitore personalizzata.
| Nome |
Tipo |
Descrizione |
|
containers
|
SessionContainer[]
|
Elenco delle definizioni di contenitore per le sessioni del pool di sessioni.
|
|
ingress
|
SessionIngress
|
Configurazione in ingresso del pool di sessioni.
|
|
registryCredentials
|
SessionRegistryCredentials
|
Credenziali del Registro Contenitori private per i contenitori usati dalle sessioni del pool di sessioni.
|
DynamicPoolConfiguration
Object
Configurazione del pool dinamico.
| Nome |
Tipo |
Descrizione |
|
lifecycleConfiguration
|
LifecycleConfiguration
|
Configurazione del ciclo di vita di una sessione nel pool di sessioni dinamiche
|
EnvironmentVar
Object
Variabile di ambiente contenitore dell'app contenitore.
| Nome |
Tipo |
Descrizione |
|
name
|
string
|
Nome della variabile di ambiente.
|
|
secretRef
|
string
|
Nome del segreto dell'app contenitore da cui eseguire il pull del valore della variabile di ambiente.
|
|
value
|
string
|
Valore della variabile di ambiente non segreto.
|
ErrorAdditionalInfo
Object
Informazioni aggiuntive sull'errore di gestione delle risorse.
| Nome |
Tipo |
Descrizione |
|
info
|
object
|
Informazioni aggiuntive.
|
|
type
|
string
|
Tipo di informazioni aggiuntive.
|
ErrorDetail
Object
Dettagli dell'errore.
| Nome |
Tipo |
Descrizione |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Informazioni aggiuntive sull'errore.
|
|
code
|
string
|
Codice di errore.
|
|
details
|
ErrorDetail[]
|
Dettagli dell'errore.
|
|
message
|
string
|
Messaggio di errore.
|
|
target
|
string
|
Destinazione dell'errore.
|
ErrorResponse
Object
Risposta di errore
IdentitySettingsLifeCycle
Enumerazione
Usare per selezionare le fasi del ciclo di vita di un pool di sessioni durante la quale l'identità gestita deve essere disponibile.
| Valore |
Descrizione |
|
None
|
|
|
Main
|
|
LifecycleConfiguration
Object
Proprietà di configurazione del ciclo di vita di una sessione nel pool di sessioni dinamiche
| Nome |
Tipo |
Descrizione |
|
cooldownPeriodInSeconds
|
integer
(int32)
|
Periodo di raffreddamento di una sessione in secondi quando il tipo di ciclo di vita è "Timed".
|
|
lifecycleType
|
LifecycleType
|
Tipo di ciclo di vita del pool di sessioni.
|
|
maxAlivePeriodInSeconds
|
integer
(int32)
|
Periodo massimo attivo di una sessione in secondi quando il tipo di ciclo di vita è "OnContainerExit".
|
LifecycleType
Enumerazione
Tipo di ciclo di vita del pool di sessioni.
| Valore |
Descrizione |
|
Timed
|
|
|
OnContainerExit
|
|
ManagedIdentitySetting
Object
Impostazioni facoltative per un'identità gestita assegnata al pool di sessioni.
| Nome |
Tipo |
Valore predefinito |
Descrizione |
|
identity
|
string
|
|
ID risorsa di un'identità gestita assegnata dall'utente assegnata dall'utente assegnata al pool di sessioni o "sistema" per l'identità assegnata dal sistema.
|
|
lifecycle
|
IdentitySettingsLifeCycle
|
None
|
Usare per selezionare le fasi del ciclo di vita di un pool di sessioni durante la quale l'identità gestita deve essere disponibile.
|
ManagedServiceIdentity
Object
Identità del servizio gestita (identità assegnate dal sistema e/o assegnate dall'utente)
| Nome |
Tipo |
Descrizione |
|
principalId
|
string
(uuid)
|
ID entità servizio dell'identità assegnata dal sistema. Questa proprietà verrà fornita solo per un'identità assegnata dal sistema.
|
|
tenantId
|
string
(uuid)
|
ID tenant dell'identità assegnata dal sistema. Questa proprietà verrà fornita solo per un'identità assegnata dal sistema.
|
|
type
|
ManagedServiceIdentityType
|
Tipo di identità del servizio gestito (in cui sono consentiti sia i tipi SystemAssigned che UserAssigned).
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
identità User-Assigned
Set di identità assegnate dall'utente associate alla risorsa. Le chiavi del dizionario userAssignedIdentities saranno ID risorsa ARM nel formato : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. I valori del dizionario possono essere oggetti vuoti ({}) nelle richieste.
|
ManagedServiceIdentityType
Enumerazione
Tipo di identità del servizio gestito (in cui sono consentiti sia i tipi SystemAssigned che UserAssigned).
| Valore |
Descrizione |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
PoolManagementType
Enumerazione
Tipo di gestione del pool di sessioni.
| Valore |
Descrizione |
|
Manual
|
|
|
Dynamic
|
|
ScaleConfiguration
Object
Configurazione della scalabilità.
| Nome |
Tipo |
Descrizione |
|
maxConcurrentSessions
|
integer
(int32)
|
Numero massimo di sessioni contemporaneamente.
|
|
readySessionInstances
|
integer
(int32)
|
Numero minimo di istanze di sessione pronte.
|
SessionContainer
Object
Definizioni di contenitore per le sessioni del pool di sessioni.
| Nome |
Tipo |
Descrizione |
|
args
|
string[]
|
Argomenti del comando di avvio del contenitore.
|
|
command
|
string[]
|
Comando start del contenitore.
|
|
env
|
EnvironmentVar[]
|
Variabili di ambiente del contenitore.
|
|
image
|
string
|
Tag immagine contenitore.
|
|
name
|
string
|
Nome del contenitore personalizzato.
|
|
resources
|
SessionContainerResources
|
Requisiti delle risorse del contenitore.
|
SessionContainerResources
Object
Requisiti delle risorse del contenitore per le sessioni del pool di sessioni.
| Nome |
Tipo |
Descrizione |
|
cpu
|
number
(double)
|
CPU necessaria nei core, ad esempio 0,5
|
|
memory
|
string
|
Memoria necessaria, ad esempio "250 Mb"
|
SessionIngress
Object
Configurazione in ingresso del pool di sessioni.
| Nome |
Tipo |
Descrizione |
|
targetPort
|
integer
(int32)
|
Porta di destinazione nei contenitori per il traffico proveniente da ingresso
|
SessionNetworkConfiguration
Object
Configurazione della rete di sessione.
SessionNetworkStatus
Enumerazione
Stato della rete per le sessioni.
| Valore |
Descrizione |
|
EgressEnabled
|
|
|
EgressDisabled
|
|
SessionPool
Object
Pool di sessioni dell'app contenitore.
| Nome |
Tipo |
Descrizione |
|
id
|
string
(arm-id)
|
ID risorsa completo per la risorsa. Ad esempio, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
ManagedServiceIdentity
|
Identità gestite necessarie da un pool di sessioni per interagire con altri servizi di Azure per non mantenere segreti o credenziali nel codice.
|
|
location
|
string
|
Posizione geografica in cui risiede la risorsa
|
|
name
|
string
|
Nome della risorsa
|
|
properties.containerType
|
ContainerType
|
Tipo di contenitore delle sessioni.
|
|
properties.customContainerTemplate
|
CustomContainerTemplate
|
Configurazione del contenitore personalizzata se containerType è CustomContainer.
|
|
properties.dynamicPoolConfiguration
|
DynamicPoolConfiguration
|
Configurazione del pool se poolManagementType è dinamico.
|
|
properties.environmentId
|
string
(arm-id)
|
ID risorsa dell'ambiente del pool di sessioni.
|
|
properties.managedIdentitySettings
|
ManagedIdentitySetting[]
|
Impostazioni facoltative per un'identità gestita assegnata al pool di sessioni.
|
|
properties.nodeCount
|
integer
(int32)
|
Numero di nodi usati dal pool di sessioni.
|
|
properties.poolManagementEndpoint
|
string
(uri)
|
Endpoint per gestire il pool.
|
|
properties.poolManagementType
|
PoolManagementType
|
Tipo di gestione del pool di sessioni.
|
|
properties.provisioningState
|
SessionPoolProvisioningState
|
Stato di provisioning del pool di sessioni.
|
|
properties.scaleConfiguration
|
ScaleConfiguration
|
Configurazione della scalabilità del pool di sessioni.
|
|
properties.secrets
|
SessionPoolSecret[]
|
Segreti del pool di sessioni.
|
|
properties.sessionNetworkConfiguration
|
SessionNetworkConfiguration
|
Configurazione di rete delle sessioni nel pool di sessioni.
|
|
systemData
|
systemData
|
Metadati di Azure Resource Manager contenenti le informazioni createdBy e modifiedBy.
|
|
tags
|
object
|
Tag di risorsa.
|
|
type
|
string
|
Tipo di risorsa. Ad esempio, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
SessionPoolProvisioningState
Enumerazione
Stato di provisioning del pool di sessioni.
| Valore |
Descrizione |
|
InProgress
|
|
|
Succeeded
|
|
|
Failed
|
|
|
Canceled
|
|
|
Deleting
|
|
SessionPoolSecret
Object
Definizione del segreto.
| Nome |
Tipo |
Descrizione |
|
name
|
string
|
Nome segreto.
|
|
value
|
string
|
Valore segreto.
|
SessionRegistryCredentials
Object
Credenziali del Registro di sistema privato del pool di sessioni.
| Nome |
Tipo |
Descrizione |
|
identity
|
string
|
Identità gestita da usare per l'autenticazione con Registro Azure Container. Per le identità assegnate dall'utente, usare l'ID risorsa di identità assegnato dall'utente completo. Per le identità assegnate dal sistema, usare 'system'
|
|
passwordSecretRef
|
string
|
Nome del segreto che contiene la password di accesso del Registro di sistema
|
|
server
|
string
|
Server registro contenitori.
|
|
username
|
string
|
Nome utente registro contenitori.
|
systemData
Object
Metadati relativi alla creazione e all'ultima modifica della risorsa.
| Nome |
Tipo |
Descrizione |
|
createdAt
|
string
(date-time)
|
Timestamp della creazione della risorsa (UTC).
|
|
createdBy
|
string
|
Identità che ha creato la risorsa.
|
|
createdByType
|
createdByType
|
Tipo di identità che ha creato la risorsa.
|
|
lastModifiedAt
|
string
(date-time)
|
Timestamp dell'ultima modifica della risorsa (UTC)
|
|
lastModifiedBy
|
string
|
Identità che ha modificato l'ultima volta la risorsa.
|
|
lastModifiedByType
|
createdByType
|
Tipo di identità che ha modificato l'ultima volta la risorsa.
|
UserAssignedIdentity
Object
Proprietà di identità assegnate dall'utente
| Nome |
Tipo |
Descrizione |
|
clientId
|
string
(uuid)
|
ID client dell'identità assegnata.
|
|
principalId
|
string
(uuid)
|
ID entità dell'identità assegnata.
|