0

I am trying to mount an Azure file share volume to an ACI container group and instance.

C# code snippet


.DefineVolume(volumeMountName)
                    .WithExistingReadWriteAzureFileShare(shareName)
                    .WithStorageAccountName(storageAccountName)
                    .WithStorageAccountKey(storageAccountKey)
                    .Attach()
                .DefineContainerInstance(containerGroupName)
                    .WithImage($"{acrServer}/{containerImage}:{Constant.ACIVersion}")                    
                    .WithExternalTcpPort(80)
                    .WithVolumeMountSetting(volumeMountName,"/aci/logs/")
                    .WithCpuCoreCount(1.0)
                    .WithMemorySizeInGB(1.5)
                    .WithEnvironmentVariables(envVars)
                    .Attach()

Above code works fine and it launches the ACI container in Azure.

enter image description here

However, when I try to list the files from within the container , for ex: Directory.GetFiles("/aci/logs/z-vol/") or Directory.GetFiles("//z-vol//") I don't get any results, also when I write to this directory location, the new file doesn't reflect in Azure file share in the portal.

What I am missing here? I am running ubuntu image.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
Prasoon
  • 157
  • 2
  • 10
  • 1
    Do you go inside the container to see if everything is OK? – Charles Xu Jan 30 '20 at 06:27
  • my container stops itself in just seconds so I am unable to go inside the container. – Prasoon Jan 30 '20 at 06:29
  • Can you show the logs of the container? If it stops, I think there is something wrong with it. – Charles Xu Jan 30 '20 at 06:39
  • your code is duplicated or something? why does it have `.attach()` 2 times? also, you can start your container with a command like `/bin/bash -c "ls /aci/logs` or similar to see if something is mounted in that directory. – 4c74356b41 Jan 30 '20 at 06:44

1 Answers1

0

I was able to access the file share at "/aci/logs/". The volume mount name 'z-vol' holds no value on how you access the files.

Prasoon
  • 157
  • 2
  • 10