Azure: Logic App, Container , and mounting an Azure File Share

412 Views Asked by At

I am trying to run a container instance using logic apps and I need to mount an azure file share.

I am using a container with azure file share. This article is very clear on how to do this with command line. https://learn.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files This works exactly as expected:

az container create `
    --resource-group pass `
    --name $CONTAINER `
    --image "$REGISTRY/$CONTAINER::latest" `
    --restart-policy Never `
    --registry-username $USERNAME `
    --registry-password  $PASSWORD `
    --os-type Linux `
    --cpu 0.2 `
    --memory 0.5 `
    --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME `
    --azure-file-volume-account-key $STORAGE_KEY `
    --azure-file-volume-mount-path $ACI_MOUNT_PATH `
    --azure-file-volume-share-name $ACI_PERS_SHARE_NAME `
    --environment-variables ID=XXXX
az container logs --resource-group pass --name $CONTAINER    

How do you create the logic app task for the container. I found the following properties:

  • Container Volume Mount Path - 1
  • Container Volume Mount Name - 1

But I cannot see the equivalent of

--azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
--azure-file-volume-account-key $STORAGE_KEY 

Also I need to:

  • delete the container after the run
  • delete a folder in the file share after the run ( I can't find a delete folder task, just delete file)
1

There are 1 best solutions below

1
On

Make sure az is up-to-date and use the following

az container create \
    --resource-group $ACI_PERS_RESOURCE_GROUP \
    --name hellofiles \
    --image mcr.microsoft.com/azuredocs/aci-hellofiles \
    --dns-name-label aci-demo \
    --ports 80 \
    --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME \
    --azure-file-volume-account-key $STORAGE_KEY \
    --azure-file-volume-share-name $ACI_PERS_SHARE_NAME \
    --azure-file-volume-mount-path /aci/logs/