简体   繁体   English

用于容器的 Azure webapp,无法将 azure blob 存储帐户附加到容器

[英]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.

相关问题 需要将 Azure 存储帐户容器和 blob 访问级别更改为私有 - Need to change Azure Storage account containers and blob access levels to private 如何检查 Azure blob 是否存在于多个容器的存储帐户中的任何位置? - How to check if Azure blob exists anywhere in storage account in multiple containers? Azure webapp for container error try to mount blob storage - azure webapp for container error trying to mount blob storage Azure 存储帐户容器 - Azure storage account container Azure门户错误在存储帐户中创建Blob容器 - Azure Portal error creating Blob Container in Storage Account Azure Blob存储-基于容器的CORS(而非基于帐户) - Azure Blob Storage - CORS on container basis (not account basis) Azure:使用容器创建存储帐户并将 Blob 上传到 Python 中 - Azure: create storage account with container and upload blob to it in Python 使用新的 Azure.Storage.Blobs 时如何计算存储帐户中 Blob 存储容器的总大小 - How to calculate the total size of Blob storage containers in an storage account when using the new Azure.Storage.Blobs Azure网站 - 将存储(blob)和ftp附加到该存储 - Azure website - Attach storage (blob) and ftp to that storage Azure blob 存储和容器权限 - Azure blob storage and container permissions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM