Créez ou mettez à jour un pool de sessions avec les propriétés données.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}?api-version=2025-07-01
Paramètres URI
| Nom |
Dans |
Obligatoire |
Type |
Description |
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nom du groupe de ressources. Le nom ne respecte pas la casse.
|
|
sessionPoolName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-z][a-z0-9]*$
|
Nom du pool de sessions.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
ID de l’abonnement cible. La valeur doit être un UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Version de l’API à utiliser pour cette opération.
|
Corps de la demande
| Nom |
Obligatoire |
Type |
Description |
|
location
|
True
|
string
|
Emplacement géographique où réside la ressource
|
|
identity
|
|
ManagedServiceIdentity
|
Identités managées nécessaires par un pool de sessions pour interagir avec d’autres services Azure pour ne pas conserver de secrets ou d’informations d’identification dans le code.
|
|
properties.containerType
|
|
ContainerType
|
Type de conteneur des sessions.
|
|
properties.customContainerTemplate
|
|
CustomContainerTemplate
|
Configuration de conteneur personnalisée si le containerType est CustomContainer.
|
|
properties.dynamicPoolConfiguration
|
|
DynamicPoolConfiguration
|
Configuration du pool si poolManagementType est dynamique.
|
|
properties.environmentId
|
|
string
(arm-id)
|
ID de ressource de l’environnement du pool de sessions.
|
|
properties.managedIdentitySettings
|
|
ManagedIdentitySetting[]
|
Paramètres facultatifs pour une identité managée affectée au pool de sessions.
|
|
properties.poolManagementType
|
|
PoolManagementType
|
Type de gestion du pool de sessions.
|
|
properties.scaleConfiguration
|
|
ScaleConfiguration
|
Configuration de mise à l’échelle du pool de sessions.
|
|
properties.secrets
|
|
SessionPoolSecret[]
|
Secrets du pool de sessions.
|
|
properties.sessionNetworkConfiguration
|
|
SessionNetworkConfiguration
|
Configuration réseau des sessions dans le pool de sessions.
|
|
tags
|
|
object
|
Balises de ressource.
|
Réponses
| Nom |
Type |
Description |
|
200 OK
|
SessionPool
|
Mise à jour réussie
|
|
201 Created
|
SessionPool
|
La création du pool de sessions a commencé.
|
|
Other Status Codes
|
ErrorResponse
|
Réponse d’erreur courante.
|
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory.
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
| Nom |
Description |
|
user_impersonation
|
emprunter l’identité de votre compte d’utilisateur
|
Exemples
Create or Update Session Pool with lifecycle OnContainerExit Timed
Exemple de requête
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
Exemple de réponse
{
"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
Exemple de requête
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
Exemple de réponse
{
"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"
}
}
Définitions
ContainerType
Énumération
Type de conteneur des sessions.
| Valeur |
Description |
|
CustomContainer
|
|
|
PythonLTS
|
|
createdByType
Énumération
Type d’identité qui a créé la ressource.
| Valeur |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
CustomContainerTemplate
Object
Configuration de conteneur personnalisée.
| Nom |
Type |
Description |
|
containers
|
SessionContainer[]
|
Liste des définitions de conteneur pour les sessions du pool de sessions.
|
|
ingress
|
SessionIngress
|
Configuration de l’entrée du pool de sessions.
|
|
registryCredentials
|
SessionRegistryCredentials
|
Informations d’identification du registre de conteneurs privés pour les conteneurs utilisés par les sessions du pool de sessions.
|
DynamicPoolConfiguration
Object
Configuration du pool dynamique.
| Nom |
Type |
Description |
|
lifecycleConfiguration
|
LifecycleConfiguration
|
Configuration du cycle de vie d’une session dans le pool de sessions dynamiques
|
EnvironmentVar
Object
Variable d’environnement de conteneur d’application conteneur.
| Nom |
Type |
Description |
|
name
|
string
|
Nom de la variable d’environnement.
|
|
secretRef
|
string
|
Nom du secret de l’application conteneur à partir duquel extraire la valeur de la variable d’environnement.
|
|
value
|
string
|
Valeur de variable d’environnement non secrète.
|
ErrorAdditionalInfo
Object
Informations supplémentaires sur l’erreur de gestion des ressources.
| Nom |
Type |
Description |
|
info
|
object
|
Informations supplémentaires.
|
|
type
|
string
|
Type d’informations supplémentaire.
|
ErrorDetail
Object
Détail de l’erreur.
| Nom |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Informations supplémentaires sur l’erreur.
|
|
code
|
string
|
Code d’erreur.
|
|
details
|
ErrorDetail[]
|
Détails de l’erreur.
|
|
message
|
string
|
Message d’erreur.
|
|
target
|
string
|
Cible d’erreur.
|
ErrorResponse
Object
Réponse d’erreur
IdentitySettingsLifeCycle
Énumération
Permet de sélectionner les étapes de cycle de vie d’un pool de sessions pendant lesquelles l’identité managée doit être disponible.
| Valeur |
Description |
|
None
|
|
|
Main
|
|
LifecycleConfiguration
Object
Propriétés de configuration du cycle de vie d’une session dans le pool de sessions dynamiques
| Nom |
Type |
Description |
|
cooldownPeriodInSeconds
|
integer
(int32)
|
Période de refroidissement d’une session en secondes lorsque le type de cycle de vie est « Timed ».
|
|
lifecycleType
|
LifecycleType
|
Type de cycle de vie du pool de sessions.
|
|
maxAlivePeriodInSeconds
|
integer
(int32)
|
Période active maximale d’une session en secondes lorsque le type de cycle de vie est « OnContainerExit ».
|
LifecycleType
Énumération
Type de cycle de vie du pool de sessions.
| Valeur |
Description |
|
Timed
|
|
|
OnContainerExit
|
|
ManagedIdentitySetting
Object
Paramètres facultatifs pour une identité managée affectée au pool de sessions.
| Nom |
Type |
Valeur par défaut |
Description |
|
identity
|
string
|
|
ID de ressource d’une identité managée affectée par l’utilisateur qui est affectée au pool de sessions, ou « système » pour l’identité affectée par le système.
|
|
lifecycle
|
IdentitySettingsLifeCycle
|
None
|
Permet de sélectionner les étapes de cycle de vie d’un pool de sessions pendant lesquelles l’identité managée doit être disponible.
|
ManagedServiceIdentity
Object
Identité de service managée (identités affectées par le système et/ou identités affectées par l’utilisateur)
| Nom |
Type |
Description |
|
principalId
|
string
(uuid)
|
ID du principal de service de l’identité affectée par le système. Cette propriété est fournie uniquement pour une identité affectée par le système.
|
|
tenantId
|
string
(uuid)
|
ID de locataire de l’identité affectée par le système. Cette propriété est fournie uniquement pour une identité affectée par le système.
|
|
type
|
ManagedServiceIdentityType
|
Type d’identité de service managé (où les types SystemAssigned et UserAssigned sont autorisés).
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
identités User-Assigned
Ensemble d’identités affectées par l’utilisateur associées à la ressource. Les clés de dictionnaire userAssignedIdentities seront des ID de ressource ARM sous la forme : « /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. Les valeurs de dictionnaire peuvent être des objets vides ({}) dans les requêtes.
|
ManagedServiceIdentityType
Énumération
Type d’identité de service managé (où les types SystemAssigned et UserAssigned sont autorisés).
| Valeur |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned,UserAssigned
|
|
PoolManagementType
Énumération
Type de gestion du pool de sessions.
| Valeur |
Description |
|
Manual
|
|
|
Dynamic
|
|
ScaleConfiguration
Object
Mettre à l’échelle la configuration.
| Nom |
Type |
Description |
|
maxConcurrentSessions
|
integer
(int32)
|
Nombre maximal de sessions en même temps.
|
|
readySessionInstances
|
integer
(int32)
|
Nombre minimal d’instances de session prêtes.
|
SessionContainer
Object
Définitions de conteneur pour les sessions du pool de sessions.
| Nom |
Type |
Description |
|
args
|
string[]
|
Arguments de commande de démarrage du conteneur.
|
|
command
|
string[]
|
Commande de démarrage du conteneur.
|
|
env
|
EnvironmentVar[]
|
Variables d’environnement de conteneur.
|
|
image
|
string
|
Balise d’image conteneur.
|
|
name
|
string
|
Nom du conteneur personnalisé.
|
|
resources
|
SessionContainerResources
|
Exigences en matière de ressources de conteneur.
|
SessionContainerResources
Object
Configuration requise pour les ressources de conteneur pour les sessions du pool de sessions.
| Nom |
Type |
Description |
|
cpu
|
number
(double)
|
Processeur requis dans les cœurs, par exemple 0,5
|
|
memory
|
string
|
Mémoire requise, par exemple « 250 Mo »
|
SessionIngress
Object
Configuration de l’entrée du pool de sessions.
| Nom |
Type |
Description |
|
targetPort
|
integer
(int32)
|
Port cible dans les conteneurs pour le trafic à partir d’entrée
|
SessionNetworkConfiguration
Object
Configuration du réseau de session.
SessionNetworkStatus
Énumération
État réseau des sessions.
| Valeur |
Description |
|
EgressEnabled
|
|
|
EgressDisabled
|
|
SessionPool
Object
Pool de sessions d’application conteneur.
| Nom |
Type |
Description |
|
id
|
string
(arm-id)
|
ID de ressource complet pour la ressource. Par exemple, « /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} »
|
|
identity
|
ManagedServiceIdentity
|
Identités managées nécessaires par un pool de sessions pour interagir avec d’autres services Azure pour ne pas conserver de secrets ou d’informations d’identification dans le code.
|
|
location
|
string
|
Emplacement géographique où réside la ressource
|
|
name
|
string
|
Nom de la ressource
|
|
properties.containerType
|
ContainerType
|
Type de conteneur des sessions.
|
|
properties.customContainerTemplate
|
CustomContainerTemplate
|
Configuration de conteneur personnalisée si le containerType est CustomContainer.
|
|
properties.dynamicPoolConfiguration
|
DynamicPoolConfiguration
|
Configuration du pool si poolManagementType est dynamique.
|
|
properties.environmentId
|
string
(arm-id)
|
ID de ressource de l’environnement du pool de sessions.
|
|
properties.managedIdentitySettings
|
ManagedIdentitySetting[]
|
Paramètres facultatifs pour une identité managée affectée au pool de sessions.
|
|
properties.nodeCount
|
integer
(int32)
|
Nombre de nœuds que le pool de sessions utilise.
|
|
properties.poolManagementEndpoint
|
string
(uri)
|
Point de terminaison pour gérer le pool.
|
|
properties.poolManagementType
|
PoolManagementType
|
Type de gestion du pool de sessions.
|
|
properties.provisioningState
|
SessionPoolProvisioningState
|
État d’approvisionnement du pool de sessions.
|
|
properties.scaleConfiguration
|
ScaleConfiguration
|
Configuration de mise à l’échelle du pool de sessions.
|
|
properties.secrets
|
SessionPoolSecret[]
|
Secrets du pool de sessions.
|
|
properties.sessionNetworkConfiguration
|
SessionNetworkConfiguration
|
Configuration réseau des sessions dans le pool de sessions.
|
|
systemData
|
systemData
|
Métadonnées Azure Resource Manager contenant les informations createdBy et modifiedBy.
|
|
tags
|
object
|
Balises de ressource.
|
|
type
|
string
|
Type de la ressource. Par exemple, « Microsoft.Compute/virtualMachines » ou « Microsoft.Storage/storageAccounts »
|
SessionPoolProvisioningState
Énumération
État d’approvisionnement du pool de sessions.
| Valeur |
Description |
|
InProgress
|
|
|
Succeeded
|
|
|
Failed
|
|
|
Canceled
|
|
|
Deleting
|
|
SessionPoolSecret
Object
Définition du secret.
| Nom |
Type |
Description |
|
name
|
string
|
Nom du secret.
|
|
value
|
string
|
Valeur secrète.
|
SessionRegistryCredentials
Object
Informations d’identification du registre privé du pool de sessions.
| Nom |
Type |
Description |
|
identity
|
string
|
Identité managée à utiliser pour s’authentifier auprès d’Azure Container Registry. Pour les identités affectées par l’utilisateur, utilisez l’ID complet de ressource d’identité affectée par l’utilisateur. Pour les identités affectées par le système, utilisez « système »
|
|
passwordSecretRef
|
string
|
Nom du secret qui contient le mot de passe de connexion au Registre
|
|
server
|
string
|
Serveur de registre de conteneurs.
|
|
username
|
string
|
Nom d’utilisateur du registre de conteneurs.
|
systemData
Object
Métadonnées relatives à la création et à la dernière modification de la ressource.
| Nom |
Type |
Description |
|
createdAt
|
string
(date-time)
|
Horodatage de la création de ressources (UTC).
|
|
createdBy
|
string
|
Identité qui a créé la ressource.
|
|
createdByType
|
createdByType
|
Type d’identité qui a créé la ressource.
|
|
lastModifiedAt
|
string
(date-time)
|
Horodatage de la dernière modification de ressource (UTC)
|
|
lastModifiedBy
|
string
|
Identité qui a modifié la ressource pour la dernière fois.
|
|
lastModifiedByType
|
createdByType
|
Type d’identité qui a modifié la ressource pour la dernière fois.
|
UserAssignedIdentity
Object
Propriétés d’identité attribuées par l’utilisateur
| Nom |
Type |
Description |
|
clientId
|
string
(uuid)
|
ID client de l’identité affectée.
|
|
principalId
|
string
(uuid)
|
ID principal de l’identité affectée.
|