Microsoft Azure App服务:无法写入sqlite数据库 [英] Microsoft Azure App services: cannot write to sqlite database

查看:124
本文介绍了Microsoft Azure App服务:无法写入sqlite数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Microsoft Azure上部署我的Flask应用程序.在已部署的站点上,它可以正常读取数据库,但是每当我尝试写入数据库时​​,它都会给出:sqlalchemy.exc.OperationalError:(sqlite3.OperationalError)数据库已锁定

I am trying to deploy my flask app on Microsoft Azure. On the deployed site it can read the db fine, but whenever I try to write to the db, it gives: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked

我在app文件夹内的文件结构是:

My file structure inside the app folder is:

  • 模板
  • app.py
  • db.sqlite

但是,当我在本地运行时,一切正常.有什么想法可以解决这个问题吗?

However when i run it on my local, everything works fine. Any ideas how I can solve this?

推荐答案

从Package中运行将wwwroot设为只读,并且在将文件写入此目录时会收到错误消息.您可能会参考以下链接可能会有所帮助: https://github.com/Azure/app-service-announcements/issues/84

Run from Package makes wwwroot read-only, and you will receive an error when writing files to this directory. You may refer to below links might be helpful: https://github.com/Azure/app-service-announcements/issues/84

https://docs .microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package

这篇关于Microsoft Azure App服务:无法写入sqlite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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