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).
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
/var/run/secrets/kubernetes.io/serviceaccount/..2021_11_29_11_47_27.967096074/namespace
/var/run/secrets/kubernetes.io/serviceaccount/..2021_11_29_11_47_27.967096074/token
/var/run/secrets/kubernetes.io/serviceaccount/..2021_11_29_11_47_27.967096074/ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/..data/namespace
/var/run/secrets/kubernetes.io/serviceaccount/..data/ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/..data/token
/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/namespace
/var/run/secrets/kubernetes.io/serviceaccount/token
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?
Based on the example on https://learn.microsoft.com/en-us/azure/container-apps/secure-app?tabs=arm-template#example 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"
}
]
}
],