az containerapp env

Note

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

Commands to manage Container Apps environments.

Commands

az containerapp env certificate

Commands to manage certificates for the Container Apps environment.

az containerapp env certificate delete

Delete a certificate from the Container Apps environment.

az containerapp env certificate list

List certificates for an environment.

az containerapp env certificate upload

Add or update a certificate.

az containerapp env create

Create a Container Apps environment.

az containerapp env dapr-component

Commands to manage Dapr components for the Container Apps environment.

az containerapp env dapr-component list

List Dapr components for an environment.

az containerapp env dapr-component remove

Remove a Dapr component from an environment.

az containerapp env dapr-component set

Create or update a Dapr component.

az containerapp env dapr-component show

Show the details of a Dapr component.

az containerapp env delete

Delete a Container Apps environment.

az containerapp env list

List Container Apps environments by subscription or resource group.

az containerapp env logs

Show container app environment logs.

az containerapp env logs show

Show past environment logs and/or print logs in real time (with the --follow parameter).

az containerapp env show

Show details of a Container Apps environment.

az containerapp env storage

Commands to manage storage for the Container Apps environment.

az containerapp env storage list

List the storages for an environment.

az containerapp env storage remove

Remove a storage from an environment.

az containerapp env storage set

Create or update a storage.

az containerapp env storage show

Show the details of a storage.

az containerapp env update

Update a Container Apps environment.

az containerapp env create

Create a Container Apps environment.

az containerapp env create --name
                           --resource-group
                           [--certificate-file]
                           [--certificate-password]
                           [--custom-domain-dns-suffix]
                           [--dapr-instrumentation-key]
                           [--docker-bridge-cidr]
                           [--infrastructure-subnet-resource-id]
                           [--internal-only {false, true}]
                           [--location]
                           [--logs-destination {azure-monitor, log-analytics, none}]
                           [--logs-workspace-id]
                           [--logs-workspace-key]
                           [--no-wait]
                           [--platform-reserved-cidr]
                           [--platform-reserved-dns-ip]
                           [--storage-account]
                           [--tags]
                           [--zone-redundant]

Examples

Create an environment with an auto-generated Log Analytics workspace.

az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \
    --location eastus2

Create a zone-redundant environment

az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \
    --location eastus2 --zone-redundant

Create an environment with an existing Log Analytics workspace.

az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \
    --logs-workspace-id myLogsWorkspaceID \
    --logs-workspace-key myLogsWorkspaceKey \
    --location eastus2

Required Parameters

--name -n

Name of the Container Apps environment.

--resource-group -g

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

Optional Parameters

--certificate-file --custom-domain-certificate-file

The filepath of the certificate file (.pfx or .pem) for the environment's custom domain. To manage certificates for container apps, use az containerapp env certificate.

--certificate-password --custom-domain-certificate-password

The certificate file password for the environment's custom domain.

--custom-domain-dns-suffix --dns-suffix

The DNS suffix for the environment's custom domain.

--dapr-instrumentation-key

Application Insights instrumentation key used by Dapr to export Service to Service communication telemetry.

--docker-bridge-cidr

CIDR notation IP range assigned to the Docker bridge. It must not overlap with any Subnet IP ranges or the IP range defined in Platform Reserved CIDR, if defined.

--infrastructure-subnet-resource-id -s

Resource ID of a subnet for infrastructure components and user app containers.

--internal-only

Boolean indicating the environment only has an internal load balancer. These environments do not have a public static IP resource, therefore must provide infrastructureSubnetResourceId if enabling this property.

accepted values: false, true
default value: False
--location -l

Location of resource. Examples: eastus2, northeurope.

--logs-destination

Logs destination.

accepted values: azure-monitor, log-analytics, none
default value: log-analytics
--logs-workspace-id

Workspace ID of the Log Analytics workspace to send diagnostics logs to. Only works with logs destination "log-analytics". You can use "az monitor log-analytics workspace create" to create one. Extra billing may apply.

--logs-workspace-key

Log Analytics workspace key to configure your Log Analytics workspace. Only works with logs destination "log-analytics". You can use "az monitor log-analytics workspace get-shared-keys" to retrieve the key.

--no-wait

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

default value: False
--platform-reserved-cidr

IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other Subnet IP ranges.

--platform-reserved-dns-ip

An IP address from the IP range defined by Platform Reserved CIDR that will be reserved for the internal DNS server.

--storage-account

Name or resource ID of the storage account used for Azure Monitor. If this value is provided, Azure Monitor Diagnostic Settings will be created automatically.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--zone-redundant -z

Enable zone redundancy on the environment. Cannot be used without --infrastructure-subnet-resource-id. If used with --location, the subnet's location must match.

default value: False

az containerapp env delete

Delete a Container Apps environment.

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

Examples

Delete an environment.

az containerapp env delete -n MyContainerappEnvironment -g MyResourceGroup

Optional Parameters

--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.

--name -n

Name of the Container Apps Environment.

--no-wait

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

default value: False
--resource-group -g

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

--subscription

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

--yes -y

Do not prompt for confirmation.

default value: False

az containerapp env list

List Container Apps environments by subscription or resource group.

az containerapp env list [--resource-group]

Examples

List environments in the current subscription.

az containerapp env list

List environments by resource group.

az containerapp env list -g MyResourceGroup

Optional Parameters

--resource-group -g

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

az containerapp env show

Show details of a Container Apps environment.

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

Examples

Show the details of an environment.

az containerapp env show -n MyContainerappEnvironment -g MyResourceGroup

Optional Parameters

--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.

--name -n

Name of the Container Apps Environment.

--resource-group -g

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

--subscription

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

az containerapp env update

Update a Container Apps environment.

az containerapp env update [--certificate-file]
                           [--certificate-password]
                           [--custom-domain-dns-suffix]
                           [--ids]
                           [--logs-destination {azure-monitor, log-analytics, none}]
                           [--logs-workspace-id]
                           [--logs-workspace-key]
                           [--name]
                           [--no-wait]
                           [--resource-group]
                           [--storage-account]
                           [--subscription]
                           [--tags]

Examples

Update an environment's custom domain configuration.

az containerapp env update -n MyContainerappEnvironment -g MyResourceGroup \
    --dns-suffix my-suffix.net --certificate-file MyFilePath \
    --certificate-password MyCertPass

Optional Parameters

--certificate-file --custom-domain-certificate-file

The filepath of the certificate file (.pfx or .pem) for the environment's custom domain. To manage certificates for container apps, use az containerapp env certificate.

--certificate-password --custom-domain-certificate-password

The certificate file password for the environment's custom domain.

--custom-domain-dns-suffix --dns-suffix

The DNS suffix for the environment's custom domain.

--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.

--logs-destination

Logs destination.

accepted values: azure-monitor, log-analytics, none
--logs-workspace-id

Workspace ID of the Log Analytics workspace to send diagnostics logs to. Only works with logs destination "log-analytics". You can use "az monitor log-analytics workspace create" to create one. Extra billing may apply.

--logs-workspace-key

Log Analytics workspace key to configure your Log Analytics workspace. Only works with logs destination "log-analytics". You can use "az monitor log-analytics workspace get-shared-keys" to retrieve the key.

--name -n

Name of the Container Apps environment.

--no-wait

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

default value: False
--resource-group -g

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

--storage-account

Name or resource ID of the storage account used for Azure Monitor. If this value is provided, Azure Monitor Diagnostic Settings will be created automatically.

--subscription

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

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.