I'm using Azure Container Apps and need to configure an array through environment variables.

Abdullah Shakeel 0 Reputation points
2026-08-14T17:07:28.6233333+00:00

For example, I currently have:

domain_signup__special_domains=["x.net","y.com","y-itc.com"]

Since Azure Container Apps environment variables are strings, is it supported/recommended to store an array directly as the environment-variable value, like this?

If so, is there any Azure Container Apps documentation confirming this approach?

If not, what is the officially recommended way to store an array value in an Azure Container App environment variable

I'm looking for confirmation of the officially supported/recommended approach and the relevant Microsoft documentation.

Thanks!

Azure Container Apps
Azure Container Apps

An Azure service that provides a general-purpose, serverless container platform.


2 answers

Sort by: Oldest
  1. AI answer

    2026-08-14T17:07:47.3966667+00:00

    Azure Container Apps supports environment variables as runtime string values, including secret references. The provided documentation shows how to set key=value pairs, but it does not document any special array type for environment variables.

    Supported conclusion:

    • Azure Container Apps environment variables are configured as name/value entries.
    • Secrets can be referenced as environment variable values.
    • If duplicate variable names exist, the last one wins.
    • Updating environment variables creates a new revision.

    There is no documentation here confirming a native array-valued environment variable type for Azure Container Apps.

    For an array such as:

    domain_signup__special_domains=["x.net","y.com","y-itc.com"]
    

    the officially supported approach in the available documentation is to store it as a string value in an environment variable and have the application parse it at runtime.

    If the value is sensitive, store it as a secret and reference that secret from the environment variable:

    az containerapp update \
        -n <APP NAME> 
        -g <RESOURCE_GROUP_NAME> 
        --set-env-vars domain_signup__special_domains='["x.net","y.com","y-itc.com"]'
    

    Or, if treated as sensitive configuration, store it as a secret first and then reference it:

    az containerapp secret set \
      --resource-group "<RESOURCE_GROUP>" \
      --name "<FUNCTIONS_APP_NAME>" \
      --secrets "special-domains=[\"x.net\",\"y.com\",\"y-itc.com\"]"
    
    az containerapp update \
        -n <APP NAME> 
        -g <RESOURCE_GROUP_NAME> 
        --set-env-vars domain_signup__special_domains=secretref:special-domains
    

    The documentation provided does not state a more specific Microsoft-recommended encoding for arrays beyond using environment variables as string values or secret references.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Mohammad Altaf 360 Reputation points Microsoft External Staff Moderator
    2026-08-14T19:05:37.0866667+00:00

    Hi @Abdullah Shakeel Welcome to Microsoft Q&A, and thank you for your question.

    Azure Container Apps environment variables are stored as name/value pairs, where the value is treated as a string at runtime. Azure Container Apps does not provide a native array-type environment variable.

    If you need to store multiple values, the supported approach is to store them as a single string value, commonly in JSON format, and then parse the value within your application.

    For example:

    DOMAIN_SIGNUP_SPECIAL_DOMAINS=["x.net","y.com","y-itc.com"]

    Your application can then deserialize this JSON string into an array/list at runtime.

    Microsoft documentation for Azure Container Apps environment variables:

    https://learn.microsoft.com/azure/container-apps/environment-variables

    Therefore, storing an array-like value as a JSON-formatted string in an environment variable and parsing it in the application is the recommended approach for this scenario.

    If the assistance was helpful, kindly take a moment to click on Accept Answer and click on Yes. It will be helpful for other community members.

    Thank you!

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.