[英]Azure webapp for containers,cant attach azure blob storage account to container
i am running multi layered container app in azure using an app service call "web app for containers".我正在使用应用程序服务调用“容器的 Web 应用程序”在 azure 中运行多层容器应用程序。
i have blob storage account where i want my data to be saved, and i am trying to attach it to my app container.我有 Blob 存储帐户,我希望将数据保存在其中,并且我正在尝试将其附加到我的应用程序容器中。 i configured the "path mapping" for my container with the following parameters:
我使用以下参数为我的容器配置了“路径映射”:
{ name : AppDataVol , mouth path: /var/appdata, type:azureBlob ,AccountName:"*****" ,share name:"test-container" }
and... it seems to be ignored data do not persist it doesn't reach my storage volume, and on restart everything gone... i don't know what i am doing wrong i have been at it for almost a week!并且......它似乎被忽略了数据不会持久化它没有达到我的存储量,并且在重新启动时一切都消失了......我不知道我做错了什么我已经用了将近一个星期了!
below is my docker-compose file, to make it simple i removed the other services please help me :(下面是我的 docker-compose 文件,为了简单起见,我删除了其他服务,请帮助我:(
version: '3'
services:
app:
container_name: best-app-ever
image: 'someunknowenregistry.azurecr.io/test/goodapp:latest'
restart: always
build: .
ports:
- '3000:3000'
environment:
- NODE_ENV=production
volumes:
- AppDataVol:/appData
volumes:
AppDataVol:
As my answer explained in your previous problem, mount Azure Blob storage to your container would work for you.正如我在您之前的问题中所解释的那样,将 Azure Blob 存储挂载到您的容器对您有用。 But you need to understand the caution :
但您需要了解警告:
Linking an existing directory in a web app to a storage account will delete the directory contents.
将 Web 应用程序中的现有目录链接到存储帐户将删除目录内容。 If you are migrating files for an existing app, make a backup of your app and its content before you begin.
如果您要迁移现有应用程序的文件,请在开始之前备份您的应用程序及其内容。
It means if the directory of the image already has files, then the mount action will delete the existing files in it, not persist them.这意味着如果镜像的目录已经有文件,那么挂载操作将删除其中的现有文件,而不是持久化它们。 So mount the Blob Storage to the container, you should find the directory which is empty and will have files when the image comes into a container, then mount the blob storage to it.
所以将Blob Storage挂载到容器中,你应该找到一个空的目录,当图像进入容器时会有文件,然后将blob存储挂载到该目录中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.