az containerapp env storage

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Commands to manage storage for the Container Apps environment.

Commands

Name Description Type Status
az containerapp env storage list

List the storages for an environment.

Core GA
az containerapp env storage list (containerapp extension)

List the storages for an environment.

Extension GA
az containerapp env storage remove

Remove a storage from an environment.

Core GA
az containerapp env storage remove (containerapp extension)

Remove a storage from an environment.

Extension GA
az containerapp env storage set

Create or update a storage.

Core GA
az containerapp env storage set (containerapp extension)

Create or update a storage.

Extension GA
az containerapp env storage show

Show the details of a storage.

Core GA
az containerapp env storage show (containerapp extension)

Show the details of a storage.

Extension GA

az containerapp env storage list

List the storages for an environment.

az containerapp env storage list --name
                                 --resource-group

Examples

List the storages for an environment.

az containerapp env storage list -g MyResourceGroup -n MyEnvironment

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

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 env storage list (containerapp extension)

List the storages for an environment.

az containerapp env storage list --name
                                 --resource-group

Examples

List the storages for an environment.

az containerapp env storage list -g MyResourceGroup -n MyEnvironment

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

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 env storage remove

Remove a storage from an environment.

az containerapp env storage remove --name
                                   --resource-group
                                   --storage-name
                                   [--acquire-policy-token]
                                   [--change-reference]
                                   [--yes]

Examples

Remove a storage from a Container Apps environment.

az containerapp env storage remove -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment

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

--storage-name

Name of the storage.

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy 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.

--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 env storage remove (containerapp extension)

Remove a storage from an environment.

az containerapp env storage remove --name
                                   --resource-group
                                   --storage-name
                                   [--acquire-policy-token]
                                   [--change-reference]
                                   [--yes]

Examples

Remove a storage from a Container Apps environment.

az containerapp env storage remove -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment

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

--storage-name

Name of the storage.

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy 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.

--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 env storage set

Create or update a storage.

az containerapp env storage set --access-mode {ReadOnly, ReadWrite}
                                --account-name --azure-file-account-name
                                --azure-file-account-key --storage-account-key
                                --azure-file-share-name --file-share
                                --name
                                --resource-group
                                --storage-name
                                [--acquire-policy-token]
                                [--change-reference]
                                [--no-wait]

Examples

Create a storage.

az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --access-mode ReadOnly --azure-file-account-key MyAccountKey --azure-file-account-name MyAccountName --azure-file-share-name MyShareName

Required Parameters

--access-mode

Access mode for the AzureFile storage.

Property Value
Accepted values: ReadOnly, ReadWrite
--account-name --azure-file-account-name -a

Name of the AzureFile storage account.

--azure-file-account-key --storage-account-key -k

Key of the AzureFile storage account.

--azure-file-share-name --file-share -f

Name of the share on the AzureFile storage.

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

--storage-name

Name of the storage.

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--no-wait

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

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.

--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 env storage set (containerapp extension)

Create or update a storage.

AzureFile storage supports account key, Azure Key Vault secret, or managed identity authentication. Before using Azure Files managed identity authentication with --azure-file-identity, assign the identity to the managed environment, enable Managed Identity for SMB on the storage account, and grant the identity the Storage File Data SMB MI Admin role (a235d3ee-5935-4cfb-8cc5-a3303ad5995e) at storage account scope.

az containerapp env storage set --name
                                --resource-group
                                --storage-name
                                [--access-mode {ReadOnly, ReadWrite}]
                                [--account-name --azure-file-account-name]
                                [--acquire-policy-token]
                                [--azure-file-account-key --storage-account-key]
                                [--azure-file-identity]
                                [--azure-file-key-vault-identity --key-vault-identity]
                                [--azure-file-key-vault-secret-url --key-vault-secret-url]
                                [--azure-file-share-name --file-share]
                                [--change-reference]
                                [--no-wait]
                                [--server]
                                [--storage-type {AzureFile, NfsAzureFile}]

Examples

Create a azure file storage.

az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --access-mode ReadOnly --azure-file-account-key MyAccountKey --azure-file-account-name MyAccountName --azure-file-share-name MyShareName

Create an Azure Files storage using an account key stored in Azure Key Vault.

az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --access-mode ReadOnly --azure-file-account-name MyAccountName --azure-file-share-name MyShareName --azure-file-key-vault-secret-url https://MyVault.vault.azure.net/secrets/MyStorageAccountKey --azure-file-key-vault-identity MyIdentityResourceId

Create an Azure Files storage using a user-assigned managed identity.

az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --access-mode ReadWrite --azure-file-account-name MyAccountName --azure-file-share-name MyShareName --azure-file-identity MyIdentityResourceId

Create an Azure Files storage using the system-assigned managed identity.

az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --access-mode ReadWrite --azure-file-account-name MyAccountName --azure-file-share-name MyShareName --azure-file-identity system

Create a nfs azure file storage.

az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --storage-type NfsAzureFile --access-mode ReadOnly --server MyNfsServer.file.core.windows.net --file-share /MyNfsServer/MyShareName

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

--storage-name

Name of the storage.

Optional Parameters

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

--access-mode

Access mode for the AzureFile or nfs AzureFile storage.

Property Value
Accepted values: ReadOnly, ReadWrite
--account-name --azure-file-account-name -a

Name of the AzureFile storage account.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--azure-file-account-key --storage-account-key -k

Key of the AzureFile storage account.

--azure-file-identity
Preview

Managed identity to authenticate with Azure Files. Use 'system' or a user-assigned identity. The identity must be assigned to the managed environment and have the Storage File Data SMB MI Admin role on the storage account. Managed Identity for SMB must be enabled on the storage account.

--azure-file-key-vault-identity --key-vault-identity
Preview

Managed identity to authenticate with Azure Key Vault. Use 'system' or a user-assigned identity. Defaults to 'system'.

--azure-file-key-vault-secret-url --key-vault-secret-url
Preview

Azure Key Vault secret URL containing the Azure Files storage account key.

--azure-file-share-name --file-share -f

Name of the share on the AzureFile or nfs AzureFile storage.

--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--no-wait

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

Property Value
Default value: False
--server -s
Preview

Server of the NfsAzureFile storage account.

--storage-type
Preview

Type of the storage. Assumed to be AzureFile if not specified.

Property Value
Accepted values: AzureFile, NfsAzureFile
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 env storage show

Show the details of a storage.

az containerapp env storage show --name
                                 --resource-group
                                 --storage-name

Examples

Show the details of a storage.

az containerapp env storage show -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment

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

--storage-name

Name of the storage.

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 env storage show (containerapp extension)

Show the details of a storage.

az containerapp env storage show --name
                                 --resource-group
                                 --storage-name

Examples

Show the details of a storage.

az containerapp env storage show -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment

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

--storage-name

Name of the storage.

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