【Azure 应用服务】应用服务中发布Docker Container,如何添加卷(如Azure File Share)以便永久存储文件
问题描述
应用服务中发布Docker Container,如何添加卷(如Azure File Share)以便永久存储文件
问题解答
App Service可以通过门户配置Mount Storage,用于添加卷(Volumes)。 操作办法见:https://docs.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?pivots=container-linux&tabs=portal#mount-storage-to-linux-container
Mount storage to Linux container
-
In the Azure portal, navigate to the app.
-
From the left navigation, click Configuration > Path Mappings > New Azure Storage Mount.
-
Configure the storage mount according to the following table. When finished, click OK.
Setting Description Name Name of the mount configuration. Spaces are not allowed. Configuration options Select Basic if the storage account is not using service endpoints or private endpoints. Otherwise, select Advanced. Storage accounts Azure Storage account. Storage type Select the type based on the storage you want to mount. Azure Blobs only supports read-only access. Storage container or Share name Files share or Blobs container to mount. Access key (Advanced only) Access key for your storage account. Mount path Directory inside the Linux container to mount to Azure Storage. Do not use /
or/home
.
Note
Adding, editing, or deleting a storage mount causes the app to be restarted.
但是,如果使用的Multi-Container部署的App Service,还需要再Compose yaml file文件中指定 Mount的文件夹Path。
version: '3.1' services: nginx: image: nginx:latest ports: - 8080:80 volumes: - storagecustomid:/test/mount
参考资料
使用自定义容器将自定义软件迁移到 Azure 应用服务: https://docs.microsoft.com/zh-cn/azure/app-service/tutorial-custom-container?pivots=container-linux
在 Azure 容器实例中装载 Azure 文件共享:https://docs.microsoft.com/zh-cn/azure/container-instances/container-instances-volume-azure-files
Mount storage to Linux container:https://docs.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?pivots=container-linux&tabs=portal#mount-storage-to-linux-container
- 【Azure 应用服务】App Service For Windows 中如何设置代理实现前端静态文件和后端Java Spring Boot Jar包
- 【Azure App Service For Container】创建ASP.NET Core Blazor项目并打包为Linux镜像发布到Azure应用服务
- 【Azure 应用服务】在Azure Funciton中使用Powershell脚本函数,需要存储一些变量值如何解决?
- 【Azure 存储服务】如何把开启NFS 3.0协议的Azure Blob挂载在Linux VM中呢?(NFS: Network File System 网络文件系统)
- 前不久,微软发布了其网络硬盘的正式版本:Windows Live Skydrive。它面向公共用户免费提供5G空间,最大单个文件支持到50M,还提供个人文件夹。微软的东西,当然会让人更放心一些,而且最重要的是它提供永久存储服务,还提供超链接!
- 【Azure 应用服务】Azure App Service (Windows) 使用Flask框架部署Python应用,如何在代码中访问静态文件呢?如何设置文件路径?是相对路径还是绝对路径呢?
- 如何正确的在Android中存储特定应用文件
- 如何用bat文件快速发布.net创建的widows服务
- 【Azure 应用服务】如何关掉App Service/Function App的FTP部署, 使之变成FTPS
- 如何使用Azure云服务和SQL Database部署PHP应用
- Microsoft Azure IoTHub Serials 2 - 如何为android应用添加IoTHub支持
- 【Azure 应用服务】App Service For Linux 部署Java Spring Boot应用后,查看日志文件时的疑惑
- tomcat安装配置、内存设置、绿色版添加后台服务启动,动态IP无公网IP发布tomcat应用到外网
- ASP.NET 5 MVC6系列教程 (四):向视图中添加服务和发布应用到公有云
- 【Azure 应用服务】App Service 默认开放端口说明, 如何禁用Web app的端口号?
- 【Azure 应用服务】App Service 通过 wardeploy 部署 war 包,如何指定到 root目录为wwwroot
- 微软开放技术发布开源 Jenkins 插件以将 Windows Azure Blob 服务用的开作存储库
- ASP.NET 5系列教程 (四):向视图中添加服务和发布应用到公有云
- 解析如何利用一个ASP.NET Core应用来发布静态文件
- 如何在系统应用中添加一个没有源码只有apk文件的应用模块