0

I'm stuck with an issue I have trying to setup persistent file-storage for a Container App in the Azure cloud. I'm followed this tutorial: https://learn.microsoft.com/en-us/azure/container-apps/storage-mounts-azure-files?tabs=bash

My problem is in "Create the storage mount" point 9: I updated the app.yaml and I run the command to create a new revision. It succeeds in the terminal, but in the Revisions list on the Azure page, the new revision fails to start. It's execution status is "faulty" but it does not provide any details what failed. Only in the system log, I once got an error message without error code just saying the storagemount failed - no reason given.

This are the parts of my app.yml I edited:

...
  template:
    containers:
    - image: nginx
      name: trendy-app
      resources:
        cpu: 0.5
        ephemeralStorage: 2Gi
        memory: 1Gi
      volumeMounts:
      - volumeName: trendy-file-volume
        mountPath: /var/log/nginx
    initContainers: null
    revisionSuffix: ''
    scale:
      maxReplicas: 1
      minReplicas: 1
      rules: null
    serviceBinds: null
    terminationGracePeriodSeconds: null
    volumes:
    - name: trendy-file-volume
      storageName: trendystoragemount
      storageType: AzureFile
    - name: trendy-app
      storageType: EmptyDir
  workloadProfileName: Consumption
...

When I remove the configuration lines for the volumeMounts, the container starts as expected - just without the mounted storage obviously. When I add it, but use a non-existing name, the az containerapp update command fails with a meaningful error, that the mount does not exist. With the config about, the command runs, but startup of the container fails. So yeah, something is wrong on the config of the storage volume, but I don't know how to find out what.

I checked the names and tried re-running the commands in the tutorial, but did not find my mistake. At this point I'm stuck and need help how I can debug this.

Thank you, Dahie

Dahie
  • 101

1 Answers1

0

I think your app.yml is incorrect please check the logs, but it should look something like this (for example).

name: nginx-azure-app
location: eastus
resourceGroup: myResourceGroup
containerName: nginx-container
cpu: 0.5
memory: 0.5Gi
instanceCount: 1

services:

  • name: nginx-service image: nginx ports:
    • protocol: TCP port: 80
    volumeMounts:
    • name: nginx-volume mountPath: /usr/share/nginx/html
    • name: nginx-logs mountPath: /var/log/nginx

volumes:

  • name: nginx-volume storageName: mystorageshare storageType: AzureFile shareName: myshare readOnly: false secretName: mystoragesecret secretMountPath: /mnt/azure

  • name: nginx-logs storageName: mystorageshare storageType: AzureFile shareName: myshare readOnly: false secretName: mystoragesecret secretMountPath: /mnt/azure-logs

secrets:

  • name: mystoragesecret storageAccount: mystorageaccount shareName: myshare accessKey: mystorageaccesskey

Turdie
  • 2,945