0

Getting started with Azure services here and I'd like to be able to have a "lighter" datastore for smaller solutions. Can anyone explain how to enable/setup SQLite with an Azure service? Is that done from Visual Studio or do I have to enable it while deploying to Azure?

I have googled every conceivable combination of keywords I can think of and came up with nothing but a feeling it's "easily achievable" but no hints as to hos it's done.

What I have is actually a mobile back-end that is using SQLite but I have no clue how I did that! There where certainly no datastore-setup wizard when I created it but when I go to the "Quicklinks" to download staged projects for clint projects I see that the back-end is indeed configured to use SQLite. I have tried a couple of different approaches to try and reproduce it but so far I have failed.

Jonas Rembratt
  • 1,550
  • 3
  • 17
  • 39
  • I was just creating a quick spike to try out the standard offline sync features of Xamarin. I created a mobile back end (which is staged with a persistent "todo list" by the project template). For some reason the Azure mobile backend enabled SQLite for this, which is great (I'd like to avoid creating resources with a price tag for small spikes like this) but I have no clue what I did to enable it. That's what I'm trying to figure out. I assume that if I create the back end service in Visual Studio, enable SQLite and then deploy it it will work. But how's that done directly from Azure? – Jonas Rembratt Jun 21 '17 at 14:57

1 Answers1

1

As far as I know, the azure mobile app doesn't support enable the SQLite from the azure.

In the azure portal you could only enable the azure table storage and azure sql database as the mobile app's backend database.

You could see this image:

enter image description here

If you want to use SQLite in your mobile app's backend, you need enable it by yourself in the project.

You need firstly install the System.Data.SQLite package and replace the connection string as SQLite connection string. At last you need deploy your mobile backend to the azure with the SQLite file. More details about how to install the SQLite in your mobile beckend, you could refer to this article.

Notice:

1.SQLite EF provider doesn't support the EDM.DateTimeOffset type. But the azure mobile app quick start backend sample use the DateTimeOffset. So if you want to use the SQLite as your mobile app backend, you need write your own model.

The mobile app backend EntityData class:

enter image description here

2.After you published the application to the mobile app, you need also copy the SQLite.Interop.dll to your application root folder.

enter image description here

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65