Hosting SQLite DB on Azure Storage? - sqlite

I need to host an SQLite database on Azure that will be shared among several web apps. My only options seem to be Azure Blob or File Storage (since they got rid of the "Azure Websites" that provided dedicated storage shared among web instances). However, there does not appear to be any way to map an Azure Storage share to a drive that the Web App will recognize, and thus no way to generate a path that SQLite can use. And obviously, SQLite can't use REST APIs to access the DB without tremendous hacking in the SQLite VFS.
So I'm wondering if anyone has successfully hosted an SQLite DB on Azure Storage such that it was accessible to a Web App?

Azure Web Apps (formerly known as Web Sites) still exists, and still has durable, shared storage across your web app instances.
You cannot use a blob to hold SQLite, as it is not compatible with file I/O (it has a REST API for access). And you cannot simply attach an Azure File Storage volume (you can use one, via API, but cannot mount it to an Azure Web App instance).
Nothing's changed with Web Apps: just place your SQLite database in a directory underneath your app's root directory.

Related

SQLite isolated from other apps

I cannot find an answer after searching on the internet, but if my app creates a database on mobile device named 'myDB' with a table called 'users' what happens if another vendor's app on the user's device creates the exact same name? Are the databases isolated by app?
If you're talking about a Android device: yes, other apps can't access your app database. (unless they have root access)
Android provides full support for SQLite databases. Any databases you create will be accessible by name to any class in the application, but not outside the application.
http://developer.android.com/intl/pt-br/guide/topics/data/data-storage.html#db

Image & video library uploads AWS, cloud front using asp.net

I need to develop an web based app in .net and upload image, Files and videos to AWS using asp.net and also make these files downloadable using link to aws source.
Looking at Amazon AWS sort of confused me. with so many products.
I would appreciate how can we develop .net based app which will upload different kinds of large files to amazon aws .
We want to host this app on different Server and upload file to aws server.
Not sure where to start from of what products to look for on amazon.
Confused with cloud front, amzon buckets etc..
After re-reading your question and noticing that you want to host your app externally to AWS, all you will need at this point is:
S3 (Simple Storage Storage)
This will host your static files - images, videos, files. Files stored in S3 can be made publically accessible via URL.
Your .NET application will make use of the AWS S3 SDK for interacting with your S3 bucket. This abstracts the technical details and makes it simple to CRUD files in S3.
Here's an example of the code you'll need.
At a high level, what you'll need to do:
Create Amazon AWS account
Create S3 bucket
Include AWS S3 SDK to your application
Deploy and test
Authentication
If you want to make some or all of the files in your S3 bucket public, you will create a bucket policy.
As your application is not going to be hosted in AWS, you will be authenticating using access keys, ensure these are protected and also ensure these are not generated from your root AWS account.

Accessing file share from Azure Website

We have a web application that consists of three main parts:
Web server running ASP.NET 4.5 Web site;
Database server hosting SQL Server 2012;
Another server hosting some Legacy App used by back office;
Relations between parts are as follows:
Web application runs with App Pool Identity set to local user called Foo and consumes database using Entity Framework;
Legacy app consumes database and periodically exports data changes in file system as XML files, folder is shared to local user Foo (local user has the same password as on Web Server) using Windows File Share feature;
Web application monitors file share for new data and imports all the changes if any;
Now we would like to migrate this application to Azure. Unfortunately we have to use VM for SQL Server because our legacy app database uses File Stream feature which is not available on Azure SQL. Also, we need another VM for legacy app.
Currently I have ended up with the following:
Created a new Virtual Network on Azure;
Created a new Azure Website and connected it to VNET using Point-To-Site VPN connection;
Created 2 VM's for SQL Server and legacy app and connected both to VNET, marked network as private network, disabled firewall;
Everything works fine except one thing - Website is unable to access file share located on Legacy App VM. I have tried to enable sharing to Everyone but to no avail.
So, my question: is it possible to access a file share from an Azure website? If not, what alternatives do I have?
I know that we could spin up another VM for Website and then I would have no issues but I would like to use Azure Website to optimize costs and make use of all Azure goodies.
At the time of writing Azure file service SMB shares are only accessible from VMs, Web- and Worker roles. You can use the storage REST.API or client library to access your files from Azure Websites or on-premise. You can get it from nuget.
Install-Package WindowsAzure.Storage
I went through the same exercise of moving a web application that used files to Azure.
Example of what I did.

File system issue when porting an ASP.NET application to Azure

I have an existing ASP.NET website that I would like to port to Azure within my free trial.
I would like the migration to be as painless as possible. The application uses log4net and NHibernate, plus it needs to share data with an application supposed to run on a virtual server.
Two questions can be asked as 1
How do I configure paths in Web.config to access a shared drive?
I need to configure the paths into which logs will be stored and, most important, I have to specify where the application will read the files written by the daemon that will run on my Azure Linux VM.
When both the app and the daemon ran on the same server (yes, I had Mono running fine) I just had to choose a shared local directory.
I'm not sure I'm totally understanding the scenario, but I'll try to give you a few options.
One - Windows Azure Web Sites (currently in Preview) could be a great option for your ASP.NET site. Of course, it depends what needs your site has. But, you can write your log4net files with web site and using NHibernate too.
Two - Web roles work great for situations like this. You would likely have to change some code to use blob storage for persistant file storage. You could use Windows Azure drives as a way to get a persistent location for log files. Windows Azure drives don't have a pre-determined drive letter, so you'd want to use the API to get to that. That may, or may not, be a good option for your situation. With web roles you could also write the log4net files to local storage and use Windows Azure diagnostics to transfer them periodically to blob storage. Just another way to persist the files.
Three - Using Windows Azure Virtual Machines (currently in Preview) you could write the log files to a data disk, which is backed by blob storage.
In the end, if you have files you need to share across instances and/or roles, then leveraging blob storage is likely your best option.

Compute needed to use Azure blob storage?

I have an ASP.NET application running on shared hosting and want to use Windows Azure blob storage to store images (my shared hosting has limited storage). My application will upload and download these images from/to the client PC.
I created a new cloud project to test this out and got it working successfully with the offline storage emulator, but I noticed that the cloud project has a web worker role which, I believe, needs a compute instance when deployed to Azure. Azure storage is very cheap, but if I need a compute instance for my application to talk to to access it then it becomes much more expensive, even with the smallest instance.
My question is - do I need a compute instance in order to upload and download files to blob storage or can my application talk directly to the blob storage?
Short answer: You do not need compute instances to talk to Azure storage. You can talk to Azure storage directly from client apps or from apps hosted by other providers.
Nor do you need to create a new Cloud project within Visual Studio to take advantage of Azure blob storage. Simply, reference appropriate .DLLs (Azure Storage Client) and you're good to go.

Resources