Permission denied while trying to mount Azure Fileshare volume in a Container App

Victor Angelier@NGBlu 0 Reputation points
2024-09-13T15:07:56.53+00:00

I receive this error when trying to create a new Container App revision.

{"TimeStamp":"2024-09-13 14:41:30 \u002B0000 UTC","Type":"Warning","ContainerAppName":"io2-api","RevisionName":"****","ReplicaName":"****","Msg":"Container \u0027io2-api\u0027 was terminated with exit code \u0027\u0027 and reason \u0027VolumeMountFailure\u0027. One or more errors occurred. (Shell command exited with non-zero status code. StatusCode = 32 | StdOut =  | StdErr = mount error(13): Permission denied\nRefer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)\n) (Shell command exited with non-zero status code. StatusCode = 32 | StdOut =  | StdErr = mount error(13): Permission denied\nRefer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)\n)","Reason":"ContainerTerminated","EventSource":"ContainerAppController","Count":7}
{"TimeStamp":"2024-09-13T14:41:31Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Shutting down events stream. Max connection open time reached","Reason":"CloseConnectionDueToTimeout","EventSource":"ContainerAppController","Count":1}

This is my bicep file:

volumeMounts: [
            {
              mountPath: '/home/storage'
              volumeName: 'dev-volume'
            }
          ]
        }
      ]
      volumes: [
        {
          name: 'dev-volume'
          storageName: 'container-volume'
          storageType: 'AzureFile'
        }
      ]

I configured the container-volume name in the Container App Environment with staging-storage (storage account) and api (fileshare).

The Container App environment uses a managed identity and I configured the SMB contributor role.

The container is in the same VNET as the Storage and this VNET is allowed access.

I have the same setup for a different resource group and it works fine there. In the Staging resource group I can't get this to work. I hope somebody can help me out or at least give me some lead as I am out of ideas.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,283 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,114 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
406 questions
0 comments No comments
{count} votes

Your answer

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