user2009874
user2009874

Reputation: 53

Possible to add SQL server express to Azure "websites"

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

Upvotes: 5

Views: 2584

Answers (3)

XperiAndri
XperiAndri

Reputation: 1208

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

Upvotes: 0

Sing
Sing

Reputation: 4052

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.

Upvotes: 4

astaykov
astaykov

Reputation: 30903

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

Upvotes: 4

Related Questions