5

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"?

Rapptz
  • 20,807
  • 5
  • 72
  • 86
  • Possible duplicate? http://stackoverflow.com/questions/5293002/is-it-possible-to-run-sql-express-within-a-azure-web-role – Vinod Jan 25 '13 at 06:42
  • 1
    My understanding is that there is a difference between "roles" and "websites". Should i assume if its not possible on "role" its not possible on "websites" either? THX – user2009874 Jan 25 '13 at 06:47
  • 2
    @Vinod, this is not buplicate. The referenced question is about Cloud Services (Web/Worker roles) and the current question is about Azure WebSites (a different service/platform). – astaykov Jan 25 '13 at 07:14

3 Answers3

4

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).

astaykov
  • 30,768
  • 3
  • 70
  • 86
4

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.

Community
  • 1
  • 1
Sing
  • 3,942
  • 3
  • 29
  • 40
0

It is preinstalled. If you go to KUDU/Environment you will find

Connection Strings
  LocalSqlServer
    ConnectionString = data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
    ProviderName = System.Data.SqlClient
Andrii
  • 1,081
  • 1
  • 11
  • 24