![](/img/trans.png)
[英]How to mount a File Storage volume to an azure container instance using REST api
[英]Unable to view files from azure file share volume mount in ACI container
我正在尝试将 Azure 文件共享卷挂载到 ACI 容器组和实例。
C# 代码片段
.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()
上面的代码工作正常,它在 Azure 中启动了 ACI 容器。
但是,当我尝试从容器中列出文件时,例如: Directory.GetFiles("/aci/logs/z-vol/") or Directory.GetFiles("//z-vol//")
我不没有得到任何结果,当我写入此目录位置时,新文件也不会反映在门户中的 Azure 文件共享中。
我在这里缺少什么? 我正在运行 ubuntu 图像。
我能够访问位于“/aci/logs/”的文件共享。 卷挂载名称“z-vol”对您访问文件的方式没有任何价值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.