BeGreen
BeGreen

Reputation: 951

Azure Container App secret volume keeps the file in base64

I'm trying to create cert files in my container in ACA. I'm using Bicep + a json parameter file to configure my deployment.

In the bicep I made a secret :

secrets: [
        {
          name: '{{ prj.cacert.name }}'
          value: '{{ prj.cacert.content }}'
        }
]

Value between {{ and }} are replaced with strings with XL-Deploy. prj.cacert.name is a simple string like my-cert and prj.cacert.content is the content of the file in base64.

Then I add Volume and volume mounts:

volumeMounts: [
{
                    volumeName: "cert-volume"
                    mountPath: "/certs/"
                }
]

...

volumes: [
                {
                    name: 'cert-volume',
                    storageType: 'Secret',
                    secrets: [
                        {
                            path: '{{ prj.cacert.name }}',
                            secretRef: '{{ prj.cacert.name }}'
                        }
                    ]
                }
            ]

The deployement is successful, but when connecting to the app with the console, I check the content of the file, it's in base64. I want my file to have the decoded string of the base644 content, not the base64 directly in my file.

From the documentation https://learn.microsoft.com/en-us/azure/container-instances/container-instances-volume-secret#mount-secret-volume---resource-manager, it says that the content must be in base64, and it will create the file. Also if I don't provide a storageType then the files are not created. Regarding this documentation https://learn.microsoft.com/en-us/azure/templates/microsoft.app/containerapps?pivots=deployment-language-bicep#volume it says it will make a EmptyDir by default.

Upvotes: 0

Views: 65

Answers (0)

Related Questions