Reputation: 53
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
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
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.
Step by Step like this:
Install two Nuget packages (EntityFrame.SqlServerCompact
& Microsoft SQL Server Compact Edition
)
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" />)
Publish full project include above SQL database file to AzureWebsites.
You'll find it can work well, and is totally free.
Upvotes: 4
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