Locating SQLite file on Azure after publishing WebAPI

Sinzore 40 Reputation points
2023-10-21T13:50:04.54+00:00

Hello,

I have developed an API that relies on an SQLite database to function correctly. When working with the API locally, I can easily locate and specify the file path in my DbContext class.

However, the challenge arises when I publish the application, as I am uncertain about the location of the SQLite file and how to effectively locate it in the deployed environment on Azure.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,070 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 26,321 Reputation points Microsoft Employee
    2023-10-21T16:37:55.86+00:00

    Hey @Sinzore

    When you deploy your site, the contents are deployed to home/site/wwwroot. Depending on where your db file is, it would be relative to that directory. Have a look at Understanding the Azure App Service file system to learn more.

    However, I will caution that you it is not recommended to use this file to store any application related data. Sqlite utilizes file handles and locks so if you were to ever scale your application, you could run into lock contention.


0 additional answers

Sort by: Most helpful