The ASP.NET Core 2.0 web application fails when I deploy it to Azure App Service.
This is what is being used in the project.
- ASP.NET Core 2.0 MVC Web Application
- Visual Studio 2017 Enterprise
- SQLite databases
- Code First Entity Framework
- Azure App Service
The web application works fine when I run it locally in Visual Studio. The problem results when I publish it to an Azure Web Service it cannot connect to the database. It states the following error when navigating to the deployed web application URL:
SqliteException: SQLite Error 1: 'no such table: Inventory'.
I've tried several times to apply an Update-Migration or an Add-Migration to the database but it will still result in the table not found when deployed to the Azure server.
Here are my SQLite connections defined in the Startup.cs file.
// Add Inventory DB
services.AddDbContext<InventoryContext>(options =>
options.UseSqlite("Data Source=Inventory.db"));
// Add User DB
services.AddDbContext<UserContext>(options =>
options.UseSqlite("Data Source=User.db"));
// Add Purchase Order DB
services.AddDbContext<PurchaseOrderContext>(options =>
options.UseSqlite("Data Source=PurchaseOrder.db"));