Container Apps Session Pools - Create Or Update
Create or update a session pool with the given properties.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}?api-version=2026-01-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
session
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[a-z][a-z0-9]*$ |
Name of the session pool. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| location | True |
string |
The geo-location where the resource lives |
| identity |
Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or credentials in code. |
||
| properties.containerType |
The container type of the sessions. |
||
| properties.customContainerTemplate |
The custom container configuration if the containerType is CustomContainer. |
||
| properties.dynamicPoolConfiguration |
The pool configuration if the poolManagementType is dynamic. |
||
| properties.environmentId |
string (arm-id) |
Resource ID of the session pool's environment. |
|
| properties.managedIdentitySettings |
Optional settings for a Managed Identity that is assigned to the Session pool. |
||
| properties.poolManagementType |
The pool management type of the session pool. |
||
| properties.scaleConfiguration |
The scale configuration of the session pool. |
||
| properties.secrets |
The secrets of the session pool. |
||
| properties.sessionNetworkConfiguration |
The network configuration of the sessions in the session pool. |
||
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Update succeeded |
|
| 201 Created |
Session pool creation has started. |
|
| Other Status Codes |
Common error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
|
Create or Update Session Pool with lifecycle On |
| Create or Update Session Pool with lifecycle type Timed |
Create or Update Session Pool with lifecycle OnContainerExit Timed
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool?api-version=2026-01-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"
}
]
}
}
Sample response
{
"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
Sample request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool?api-version=2026-01-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"
}
]
}
}
Sample response
{
"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"
}
}
Definitions
| Name | Description |
|---|---|
|
Container |
The container type of the sessions. |
|
created |
The type of identity that created the resource. |
|
Custom |
Custom container configuration. |
|
Dynamic |
Dynamic pool configuration. |
|
Environment |
Container App container environment variable. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Identity |
Use to select the lifecycle stages of a Session Pool during which the Managed Identity should be available. |
|
Lifecycle |
The lifecycle configuration properties of a session in the dynamic session pool |
|
Lifecycle |
The lifecycle type of the session pool. |
|
Managed |
Optional settings for a Managed Identity that is assigned to the Session pool. |
|
Managed |
Managed service identity (system assigned and/or user assigned identities) |
|
Managed |
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). |
|
Pool |
The pool management type of the session pool. |
|
Scale |
Scale configuration. |
|
Session |
Container definitions for the sessions of the session pool. |
|
Session |
Container resource requirements for sessions of the session pool. |
|
Session |
Session pool ingress configuration. |
|
Session |
Session network configuration. |
|
Session |
Network status for the sessions. |
|
Session |
Container App session pool. |
|
Session |
Provisioning state of the session pool. |
|
Session |
Secret definition. |
|
Session |
Session pool private registry credentials. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
User |
User assigned identity properties |
ContainerType
The container type of the sessions.
| Value | Description |
|---|---|
| CustomContainer | |
| PythonLTS |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
CustomContainerTemplate
Custom container configuration.
| Name | Type | Description |
|---|---|---|
| containers |
List of container definitions for the sessions of the session pool. |
|
| ingress |
Session pool ingress configuration. |
|
| registryCredentials |
Private container registry credentials for containers used by the sessions of the session pool. |
DynamicPoolConfiguration
Dynamic pool configuration.
| Name | Type | Description |
|---|---|---|
| lifecycleConfiguration |
The lifecycle configuration of a session in the dynamic session pool |
EnvironmentVar
Container App container environment variable.
| Name | Type | Description |
|---|---|---|
| name |
string |
Environment variable name. |
| secretRef |
string |
Name of the Container App secret from which to pull the environment variable value. |
| value |
string |
Non-secret environment variable value. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
IdentitySettingsLifeCycle
Use to select the lifecycle stages of a Session Pool during which the Managed Identity should be available.
| Value | Description |
|---|---|
| None | |
| Main |
LifecycleConfiguration
The lifecycle configuration properties of a session in the dynamic session pool
| Name | Type | Description |
|---|---|---|
| cooldownPeriodInSeconds |
integer (int32) |
The cooldown period of a session in seconds when the lifecycle type is 'Timed'. |
| lifecycleType |
The lifecycle type of the session pool. |
|
| maxAlivePeriodInSeconds |
integer (int32) |
The maximum alive period of a session in seconds when the lifecycle type is 'OnContainerExit'. |
LifecycleType
The lifecycle type of the session pool.
| Value | Description |
|---|---|
| Timed | |
| OnContainerExit |
ManagedIdentitySetting
Optional settings for a Managed Identity that is assigned to the Session pool.
| Name | Type | Default value | Description |
|---|---|---|---|
| identity |
string |
The resource ID of a user-assigned managed identity that is assigned to the Session Pool, or 'system' for system-assigned identity. |
|
| lifecycle | None |
Use to select the lifecycle stages of a Session Pool during which the Managed Identity should be available. |
ManagedServiceIdentity
Managed service identity (system assigned and/or user assigned identities)
| Name | Type | Description |
|---|---|---|
| principalId |
string (uuid) |
The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. |
| tenantId |
string (uuid) |
The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. |
| type |
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). |
|
| userAssignedIdentities |
<string,
User |
User-Assigned Identities |
ManagedServiceIdentityType
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
| Value | Description |
|---|---|
| None | |
| SystemAssigned | |
| UserAssigned | |
| SystemAssigned,UserAssigned |
PoolManagementType
The pool management type of the session pool.
| Value | Description |
|---|---|
| Manual | |
| Dynamic |
ScaleConfiguration
Scale configuration.
| Name | Type | Description |
|---|---|---|
| maxConcurrentSessions |
integer (int32) |
The maximum count of sessions at the same time. |
| readySessionInstances |
integer (int32) |
The minimum count of ready session instances. |
SessionContainer
Container definitions for the sessions of the session pool.
| Name | Type | Description |
|---|---|---|
| args |
string[] |
Container start command arguments. |
| command |
string[] |
Container start command. |
| env |
Container environment variables. |
|
| image |
string |
Container image tag. |
| name |
string |
Custom container name. |
| resources |
Container resource requirements. |
SessionContainerResources
Container resource requirements for sessions of the session pool.
| Name | Type | Description |
|---|---|---|
| cpu |
number (double) |
Required CPU in cores, e.g. 0.5 |
| memory |
string |
Required memory, e.g. "250Mb" |
SessionIngress
Session pool ingress configuration.
| Name | Type | Description |
|---|---|---|
| targetPort |
integer (int32) |
Target port in containers for traffic from ingress |
SessionNetworkConfiguration
Session network configuration.
| Name | Type | Description |
|---|---|---|
| status |
Network status for the sessions. |
SessionNetworkStatus
Network status for the sessions.
| Value | Description |
|---|---|
| EgressEnabled | |
| EgressDisabled |
SessionPool
Container App session pool.
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| identity |
Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or credentials in code. |
|
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.containerType |
The container type of the sessions. |
|
| properties.customContainerTemplate |
The custom container configuration if the containerType is CustomContainer. |
|
| properties.dynamicPoolConfiguration |
The pool configuration if the poolManagementType is dynamic. |
|
| properties.environmentId |
string (arm-id) |
Resource ID of the session pool's environment. |
| properties.managedIdentitySettings |
Optional settings for a Managed Identity that is assigned to the Session pool. |
|
| properties.nodeCount |
integer (int32) |
The number of nodes the session pool is using. |
| properties.poolManagementEndpoint |
string (uri) |
The endpoint to manage the pool. |
| properties.poolManagementType |
The pool management type of the session pool. |
|
| properties.provisioningState |
Provisioning state of the session pool. |
|
| properties.scaleConfiguration |
The scale configuration of the session pool. |
|
| properties.secrets |
The secrets of the session pool. |
|
| properties.sessionNetworkConfiguration |
The network configuration of the sessions in the session pool. |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
SessionPoolProvisioningState
Provisioning state of the session pool.
| Value | Description |
|---|---|
| InProgress | |
| Succeeded | |
| Failed | |
| Canceled | |
| Deleting |
SessionPoolSecret
Secret definition.
| Name | Type | Description |
|---|---|---|
| name |
string |
Secret Name. |
| value |
string |
Secret Value. |
SessionRegistryCredentials
Session pool private registry credentials.
| Name | Type | Description |
|---|---|---|
| identity |
string |
A Managed Identity to use to authenticate with Azure Container Registry. For user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned identities, use 'system' |
| passwordSecretRef |
string |
The name of the secret that contains the registry login password |
| server |
string |
Container registry server. |
| username |
string |
Container registry username. |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
UserAssignedIdentity
User assigned identity properties
| Name | Type | Description |
|---|---|---|
| clientId |
string (uuid) |
The client ID of the assigned identity. |
| principalId |
string (uuid) |
The principal ID of the assigned identity. |