1

I have a Webapp for different customers-DBs which runs on several Application Servers. The customers are each assigned to an instance on a AS. For several of the customers, certain data is saved in additional SQLite-DBs on the Application Servers themselves; when this kind of data is added, the WebApp tests whether the according SQLite-DB already exists on this AS and if not, it creates it by using the following code:

dbFileName = "C:\\" + dbFileName;

            SQLiteConnection.CreateFile(dbFileName);

            using (System.Data.SQLite.SQLiteConnection con = new System.Data.SQLite.SQLiteConnection("data source=" + dbFileName))
            {
                using (System.Data.SQLite.SQLiteCommand com = new System.Data.SQLite.SQLiteCommand(con))
                {
                    con.Open();

The problem is that if I assign the customer to an instance on another AS, the SQLite-db has to be created again, since it can't access the one on the other AS.

Now my idea was to create the SQLite-dbs on some azure storage, where I could access it from every AS, but so far I'm not able to access it via a SQLite-Connection.

I have knowledge of my specific SAS (=Shared Access Signature) and Connectionstrings like the ones specified on https://www.connectionstrings.com/windows-azure/ but I'm not sure which part I should use for the SQLiteConnection.

Is it even possible?

The only examples on connections to Azurestorage that I found so far are via HttpRequests (like How to access Azure blob using SAS in C#) which doesn't help me or can anybody show me a way to use this for my problem?

Please tell me if you need more information, I'm kind of bad at explaining things and not taking into account that many things aren't common knowledge...

Richard
  • 25,390
  • 3
  • 25
  • 38
Talia
  • 11
  • 2

1 Answers1

0

You can not use Azure storage blob as a normal file system. The data source in SQLite connection string should be a file path or memory.

If you want to use Azure storage blob, as far as I know, you can only mount Blob storage as a file system with blobfuse on Linux OS. But this is not 100% compatible with normal file systems.

Another choice is to use Azure storage file, it supports SMB protocol. You can mount a network driver and use it.

Jack Jia
  • 5,268
  • 1
  • 12
  • 14