Share via


az containerapp sessionpool

Note

This reference is part of the containerapp extension for the Azure CLI (version 2.62.0 or higher). The extension will automatically install the first time you run an az containerapp sessionpool command. Learn more about extensions.

Commands to manage session pools.

Commands

Name Description Type Status
az containerapp sessionpool create

Create or update a Session pool.

Extension GA
az containerapp sessionpool delete

Delete a session pool.

Extension GA
az containerapp sessionpool list

List Session Pools by subscription or resource group.

Extension GA
az containerapp sessionpool show

Show details of a Session Pool.

Extension GA
az containerapp sessionpool update

Update a Session pool.

Extension GA

az containerapp sessionpool create

Create or update a Session pool.

az containerapp sessionpool create --name
                                   --resource-group
                                   [--args]
                                   [--command]
                                   [--container-name]
                                   [--container-type {CustomContainer, NodeLTS, PythonLTS}]
                                   [--cooldown-period]
                                   [--cpu]
                                   [--env-vars]
                                   [--environment]
                                   [--image]
                                   [--location]
                                   [--max-sessions]
                                   [--memory]
                                   [--mi-system-assigned]
                                   [--mi-user-assigned]
                                   [--network-status {EgressDisabled, EgressEnabled}]
                                   [--no-wait]
                                   [--ready-sessions]
                                   [--registry-identity]
                                   [--registry-password]
                                   [--registry-server]
                                   [--registry-username]
                                   [--secrets]
                                   [--target-port]

Examples

Create or update a Session Pool with container type PythonLTS default settings.

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --location eastasia

Create or update a Session Pool with container type PythonLTS, with max concurrent sessions is 30, ready session instances 20.

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type PythonLTS --max-sessions 30 --ready-sessions 20 \
    --location eastasia

Create or update a Session Pool with container type CustomContainer with default quickstart image.

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment \
    --cpu 0.5 --memory 1Gi --target-port 80 --location eastasia --image mcr.microsoft.com/k8se/quickstart:latest

Create or update a Session Pool with container type CustomContainer that has secrets and environment variables.

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment \
    --cpu 0.5 --memory 1Gi --target-port 80 --image MyImage \
    --env-vars GREETING="Hello, world" SECRETENV=secretref:anothersecret \
    --secrets mysecret=secretvalue1 anothersecret="secret value 2" --location eastasia

Create or update a Session Pool with container type CustomContainer that from private registry

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 --registry-server myregistry.azurecr.io \
    --registry-username myregistry --registry-password $REGISTRY_PASSWORD \
    --location eastasia

Create or update a Session Pool with container type CustomContainer and Managed Identity to authenticate Azure container registry

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 --registry-server myregistry.azurecr.io \
    --registry-identity  MyUserIdentityResourceId \
    --location eastasia

Create or update a Session Pool with container type CustomContainer with system assigned and user assigned identity.

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 \
    --mi-system-assigned --mi-user-assigned MyUserIdentityResourceId \
    --location eastasia

Create or update a Session Pool with container type CustomContainer with cooldown period 360s

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --environment MyEnvironment --cpu 0.5 --memory 1Gi --target-port 80 --container-type CustomContainer \
    --cooldown-period 360 --location eastasia

Required Parameters

--name -n

The Session Pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--args

A list of container startup command argument(s). Space-separated values e.g. "-c" "mycommand". Empty string to clear existing values.

Property Value
Parameter group: Container Arguments
--command

A list of supported commands on the container that will executed during startup. Space-separated values e.g. "/bin/queue" "mycommand". Empty string to clear existing values.

Property Value
Parameter group: Container Arguments
--container-name

Name of the container. On create if no container name is provided the container name will default to the name of the session pool coverted to lower case.

Property Value
Parameter group: Container Arguments
--container-type

The pool type of the Session Pool, default='PythonLTS'.

Property Value
Parameter group: Configuration Arguments
Accepted values: CustomContainer, NodeLTS, PythonLTS
--cooldown-period

Period (in seconds), after which the session will be deleted, default=300.

Property Value
Parameter group: Configuration Arguments
--cpu

Required CPU in cores from 0.25 - 2.0, e.g. 0.5.

Property Value
Parameter group: Container Arguments
--env-vars

A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret.

Property Value
Parameter group: Container Arguments
--environment

Name or resource ID of the container app's environment.

Property Value
Parameter group: Container Arguments
--image -i

Container image, e.g. publisher/image-name:tag.

Property Value
Parameter group: Container Arguments
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--max-sessions

Max count of sessions can be run at the same time.

Property Value
Parameter group: Scale Arguments
--memory

Required memory from 0.5 - 4.0 ending with "Gi", e.g. 1.0Gi.

Property Value
Parameter group: Container Arguments
--mi-system-assigned

Boolean indicating whether to assign system-assigned identity.

Property Value
Default value: False
--mi-user-assigned

Space-separated user identities to be assigned.

--network-status

Egress is enabled for the Sessions or not.

Property Value
Parameter group: Configuration Arguments
Accepted values: EgressDisabled, EgressEnabled
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--ready-sessions

The number of sessions that will be ready in the session pool all the time.

Property Value
Parameter group: Scale Arguments
--registry-identity

The managed identity with which to authenticate to the Azure Container Registry (instead of username/password). Use 'system' for a system-assigned identity, use a resource ID for a user-assigned identity. The managed identity should have been assigned acrpull permissions on the ACR before deployment (use 'az role assignment create --role acrpull ...').

Property Value
Parameter group: Registry Arguments
--registry-password

The password to log in to container registry. If stored as a secret, value must start with 'secretref:' followed by the secret name.

Property Value
Parameter group: Registry Arguments
--registry-server

The container registry server hostname, e.g. myregistry.azurecr.io.

Property Value
Parameter group: Registry Arguments
--registry-username

The username to log in to container registry.

Property Value
Parameter group: Registry Arguments
--secrets -s

A list of secret(s) for the session pool. Space-separated values in 'key=value' format. Empty string to clear existing values.

Property Value
Parameter group: Configuration Arguments
--target-port

The session port used for ingress traffic.

Property Value
Parameter group: Container Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az containerapp sessionpool delete

Delete a session pool.

az containerapp sessionpool delete --resource-group
                                   [--ids]
                                   [--name]
                                   [--no-wait]
                                   [--subscription]
                                   [--yes]

Examples

Delete a session pool.

az containerapp sessionpool delete -n mysessionpool -g MyResourceGroup

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

The Session Pool name.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az containerapp sessionpool list

List Session Pools by subscription or resource group.

az containerapp sessionpool list [--resource-group]

Examples

List Session Pools in the current subscription.

az containerapp sessionpool list

List Session Pools by resource group.

az containerapp sessionpool list -g MyResourceGroup

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az containerapp sessionpool show

Show details of a Session Pool.

az containerapp sessionpool show --resource-group
                                 [--ids]
                                 [--name]
                                 [--subscription]

Examples

Show the details of a Session Pool.

az containerapp sessionpool show -n mysessionpool -g MyResourceGroup

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

The Session Pool name.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az containerapp sessionpool update

Update a Session pool.

az containerapp sessionpool update --resource-group
                                   [--args]
                                   [--command]
                                   [--container-name]
                                   [--cooldown-period]
                                   [--cpu]
                                   [--env-vars]
                                   [--ids]
                                   [--image]
                                   [--location]
                                   [--max-sessions]
                                   [--memory]
                                   [--mi-system-assigned]
                                   [--mi-user-assigned]
                                   [--name]
                                   [--network-status {EgressDisabled, EgressEnabled}]
                                   [--no-wait]
                                   [--ready-sessions]
                                   [--registry-identity]
                                   [--registry-password]
                                   [--registry-server]
                                   [--registry-username]
                                   [--secrets]
                                   [--subscription]
                                   [--target-port]

Examples

Update a session pool's max concurrent sessions configuration and image.

az containerapp sessionpool update -n mysessionpool -g MyResourceGroup --max-sessions 20 --image MyNewImage

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--args

A list of container startup command argument(s). Space-separated values e.g. "-c" "mycommand". Empty string to clear existing values.

Property Value
Parameter group: Container Arguments
--command

A list of supported commands on the container that will executed during startup. Space-separated values e.g. "/bin/queue" "mycommand". Empty string to clear existing values.

Property Value
Parameter group: Container Arguments
--container-name

Name of the container. On create if no container name is provided the container name will default to the name of the session pool coverted to lower case.

Property Value
Parameter group: Container Arguments
--cooldown-period

Period (in seconds), after which the session will be deleted, default=300.

Property Value
Parameter group: Configuration Arguments
--cpu

Required CPU in cores from 0.25 - 2.0, e.g. 0.5.

Property Value
Parameter group: Container Arguments
--env-vars

A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret.

Property Value
Parameter group: Container Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--image -i

Container image, e.g. publisher/image-name:tag.

Property Value
Parameter group: Container Arguments
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--max-sessions

Max count of sessions can be run at the same time.

Property Value
Parameter group: Scale Arguments
--memory

Required memory from 0.5 - 4.0 ending with "Gi", e.g. 1.0Gi.

Property Value
Parameter group: Container Arguments
--mi-system-assigned

Boolean indicating whether to assign system-assigned identity.

Property Value
Default value: False
--mi-user-assigned

Space-separated user identities to be assigned.

--name -n

The Session Pool name.

Property Value
Parameter group: Resource Id Arguments
--network-status

Egress is enabled for the Sessions or not.

Property Value
Parameter group: Configuration Arguments
Accepted values: EgressDisabled, EgressEnabled
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--ready-sessions

The number of sessions that will be ready in the session pool all the time.

Property Value
Parameter group: Scale Arguments
--registry-identity

The managed identity with which to authenticate to the Azure Container Registry (instead of username/password). Use 'system' for a system-assigned identity, use a resource ID for a user-assigned identity. The managed identity should have been assigned acrpull permissions on the ACR before deployment (use 'az role assignment create --role acrpull ...').

Property Value
Parameter group: Registry Arguments
--registry-password

The password to log in to container registry. If stored as a secret, value must start with 'secretref:' followed by the secret name.

Property Value
Parameter group: Registry Arguments
--registry-server

The container registry server hostname, e.g. myregistry.azurecr.io.

Property Value
Parameter group: Registry Arguments
--registry-username

The username to log in to container registry.

Property Value
Parameter group: Registry Arguments
--secrets -s

A list of secret(s) for the session pool. Space-separated values in 'key=value' format. Empty string to clear existing values.

Property Value
Parameter group: Configuration Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--target-port

The session port used for ingress traffic.

Property Value
Parameter group: Container Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False