Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to add SQL server express to Azure "websites"

Tags:

azure

I understand that I can add SQL server express to an Azure virtual machine but can I add the DB to azure "websites", or do I need to use Azure SQL if I want to use a SQL DB for Azure "websites"?

like image 237
user2009874 Avatar asked Jan 25 '13 06:01

user2009874


2 Answers

No,

You can't use/add/install any software when using Azure WebSites. The data storage possibilities for your application running in Azure WebSites are: Azure SQL Database (former SQL Azure), Azure Blob Storage, Azure Table Storage, MySQL database (currently only provided as part of provisioning PHP CMS's in Azure WebSites).

like image 160
astaykov Avatar answered Nov 15 '22 07:11

astaykov


Yes, but you have to create a SQL Compact Edition in your root, not SQL Server Express.

I've written an article about it.

This is my related question post on StackOverflow, and this is the English version I found.

Below is the solution after my research:

Step by Step like this:

  1. Install two Nuget packages (EntityFrame.SqlServerCompact & Microsoft SQL Server Compact Edition)

  2. Put your SQL database file(.sdf/.mdf) in APP_Data folder (Add the connection string like this in order to use it:

    <add name ="DefaultConnection" connectionString ="Data Source=|DataDirectory|CompactDB.sdf" providerName ="System.Data.SqlServerCe.4.0" />)
    
  3. Publish full project include above SQL database file to AzureWebsites.

You'll find it can work well, and is totally free.

like image 30
Sing Avatar answered Nov 15 '22 08:11

Sing