Hi Per Schondell,
In order to set up a container app with an azure files volume mount, create a storage account and a file share where our container can mount files.
az storage account create \
--name arkstoragedemo \
--resource-group arkorg \
--location centralindia \
--sku Standard_LRS \
--kind StorageV2
az storage share create \
--name simplemqshare \
--account-name arkstoragedemo
Get Storage Account Key
STORAGE_KEY=$(az storage account keys list \
--account-name arkstoragedemo \
--query "[0].value" --output tsv)
If you want, you can put this in a variable
Create a Container App in the arkorg
resource group and configure it to mount the Azure File Share.
create an env for the same
az containerapp env create \
--name ark-container-env \
--resource-group arkorg \
--location centralindia
connect your file share to this environment
az containerapp env storage set \
--name ark-container-env \
--resource-group arkorg \
--storage-name simplemq \
--azure-file-account-name arkstoragedemo \
--azure-file-share-name simplemqshare \
--azure-file-account-key "$STORAGE_KEY" \
--access-mode ReadWrite
Deploy the Container App with Azure Files Mounted
Use this as reference to update your simplemq.yml
---
name: simplemqprovider
location: centralindia
type: Microsoft.App/containerApps
properties:
environmentId: >
/subscriptions/abcdefghijk/resourceGroups/arkorg/
providers/Microsoft.App/managedEnvironments/ark-container-env
configuration:
activeRevisionsMode: Single
ingress:
external: true
targetPort: 8080
traffic:
- latestRevision: true
weight: 100
template:
containers:
- name: simplemqprovider
image: docker.io/library/nginx:latest
resources:
cpu: 0.25
memory: 0.5Gi
volumeMounts:
- volumeName: simplemq
mountPath: /app/simplemq
volumes:
- name: simplemq
storageType: AzureFile
storageName: simplemq
Now try to deploy the Container App
az containerapp create \
--resource-group arkorg \
--name simplemqprovider \
--environment ark-container-env \
--yaml simplemq.yml