将SQLite数据库文件放在Azure App Service中的哪里? [英] Where to put SQLite database file in Azure App Service?

查看:115
本文介绍了将SQLite数据库文件放在Azure App Service中的哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一季度:您认为在 Azure Web App 文件中放置 SQLite 数据库文件(database.sqlite)的正确位置系统?例如:

Q1: Where do you think is the right place to put a SQLite database file (database.sqlite) in Azure Web App file system? For example:

  1. D:\home\data\database.sqlite
  2. D:\home\site\database.sqlite
  3. D:\home\site\wwwroot\database.sqlite
  4. 其他?
  1. D:\home\data\database.sqlite
  2. D:\home\site\database.sqlite
  3. D:\home\site\wwwroot\database.sqlite
  4. other?

第二季度:还应考虑其他因素,以确保公共用户将无法访问该数据库文件,并且在部署期间或在应用程序运行时不会意外覆盖该数据库文件放大/缩小? (已将Web App配置为从本地Git存储库进行部署)

Q2: What else should be taken into consideration in order to make sure that the database file won't be accessible to public users as well as not being accidentally overwritten during deployments or when the app is scaled up/down? (The Web App is configured for deployments from a Local Git Repository)

第3季度:在哪里可以详细了解Azure App Service中使用的文件系统(官方源URL)?例如.如何在单个Web应用程序中的多个VM之间共享它,如何在应用程序按比例放大/缩小时工作,D:\home(持久)与D:\local(非持久)之间有什么区别...

Q3: Where to learn more about the file system used in Azure App Service, the official source URL? E.g. how it's shared between multiple VMs within a single Web App, how does it work when the App is scaled up/down, what's the difference between D:\home (persistent) vs D:\local (non-persistent)...

请注意, SQLite Azure Blob存储中不起作用,因此不能选择.请不要建议其他存储解决方案,这个问题专门针对 SQLite .

Note that SQLite does not work in Azure Blob Storage, so that one is not an option. Please, don't suggest alternative storage solutions, this question is specifically about SQLite.

推荐答案

在Web应用程序中,您的应用程序已部署到d:\home\site\wwwroot.这是您可以写入文件的区域.例如,ghost部署将其SQLite数据库写入d:\home\site\wwwroot\content\data\ghost.db.(如果通过yourapp.scm.azurewebsites.net打开kudu控制台,则很容易看到这一点):

In a Web App, your app is deployed to d:\home\site\wwwroot. This is the area where you may write files. As an example, the ghost deployment writes its SQLite database to d:\home\site\wwwroot\content\data\ghost.db. (easy to see this, if you open up the kudu console via yourapp.scm.azurewebsites.net):

此文件区域在您的Web应用程序实例之间共享.与SMB文件共享类似,但特定于Web应用程序(与Azure的文件服务不同).

This file area is shared amongst your web app instances. Similar to an SMB file share, but specific to web apps (and different than Azure's File Service).

wwwroot下的内容是持久的,除非您删除应用程序服务.放大/缩小会影响可用空间量. (我不知道如果您按比例缩小 会发生什么,而较小的磁盘比您已经消耗的磁盘空间要少.)

The content under wwwroot is durable, unless you delete your app service. Scaling up/down impacts the amount of space available. (I have no idea what happens if you scale down and the smaller size has less disk space than what you're consuming already).

这篇关于将SQLite数据库文件放在Azure App Service中的哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆