如何访问 Azure Web Apps For Container 的持久共享存储
How to access the persistent shared storage of Azure Web Apps For Containers
我的微服务会创建一些我需要访问的文件,这些主要是存档或错误数据。
我从这里找到了 Microsoft azure 应用程序服务默认跨容器安装持久共享存储的文章
来自微软文档:
"You can use the /home
directory in your app's file system to
persist files across restarts and share them across instances. The
/home
in your app is provided to enable your container app to access
persistent storage."
现在我想访问 /home
目录来检查服务创建的文件。
我尝试了很多方法,例如使用部署凭据使用 FTPS,但我无法看到 /home
目录
如何访问挂载到 docker 容器的持久共享存储?
我无法为应用服务配置单独的存储,因为它处于预览模式,并且根据本文档不支持生产场景:
https://docs.microsoft.com/en-us/azure/app-service/containers/how-to-serve-content-from-azure-storage
找到解决方案,虽然文档here说默认情况下启用永久存储,但实际上并没有。
我对此表示怀疑并使用以下命令启用持久存储,现在我可以使用 FileZilla FTPS 访问文件
启用持久存储的命令
az webapp config appsettings set --resource-group <resource-group-name> --name <app-name> --settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=true
这里的 Test.txt 和 Test2.txt 是我的应用程序创建的文件,它们存储在持久存储中,我可以访问它们。
我的微服务会创建一些我需要访问的文件,这些主要是存档或错误数据。
我从这里找到了 Microsoft azure 应用程序服务默认跨容器安装持久共享存储的文章
来自微软文档:
"You can use the
/home
directory in your app's file system to persist files across restarts and share them across instances. The/home
in your app is provided to enable your container app to access persistent storage."
现在我想访问 /home
目录来检查服务创建的文件。
我尝试了很多方法,例如使用部署凭据使用 FTPS,但我无法看到 /home
目录
如何访问挂载到 docker 容器的持久共享存储?
我无法为应用服务配置单独的存储,因为它处于预览模式,并且根据本文档不支持生产场景:
https://docs.microsoft.com/en-us/azure/app-service/containers/how-to-serve-content-from-azure-storage
找到解决方案,虽然文档here说默认情况下启用永久存储,但实际上并没有。
我对此表示怀疑并使用以下命令启用持久存储,现在我可以使用 FileZilla FTPS 访问文件
启用持久存储的命令
az webapp config appsettings set --resource-group <resource-group-name> --name <app-name> --settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=true
这里的 Test.txt 和 Test2.txt 是我的应用程序创建的文件,它们存储在持久存储中,我可以访问它们。