Reading secrets from inside a container app

Peter Hultqvist 21 Reputation points

I'm running a linux container with Azure Container Apps(Preview).

The secrets are defined in the Azure portal.

How can I access these secrets from inside the container?
They don't appear as environment variables.
There is no /mnt/secrets directory.

There is a /var/run/secrets and /run/secrets, both containing the following items.
But no one of the defined keys from the portal is listed here.


The key for the secrets was required to be lowercase only which might indicate that this is some other kind of configuration.
Still the description above the list of key-value pairs clearly states: "Secrets are key/value pairs than can be used to protect sensitive data like passwords and connection strings."

How can the running container access the secrets?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
23,934 questions
{count} votes

Accepted answer
  1. vipullag-MSFT 16,736 Reputation points Microsoft Employee

    @Peter Hultqvist

    Currently Azure Container Apps is not supported on this Microsoft Q&A platform.

    Please check the supported products list here (more to be added later on).

    No comments

1 additional answer

Sort by: Most helpful
  1. Nils Hedström 1 Reputation point

    Based on the example on I was able to access secrets from my Azure Container App

    The key was to create an environmental variable with a referece to the secret
    "template": {
    "containers": [
    "image": "myregistry/myQueueApp:v1",
    "name": "myQueueApp",
    "env": [
    "name": "QueueName",
    "value": "myqueue"
    "name": "ConnectionString",
    "secretref": "queue-connection-string"

    No comments