Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Free SQL Server in Azure

I'm creating a MVC 5 web application with EF 6 Code first. Now it creates a database in the App_Data folder. I want to publish the website to an Azure website. Because this is only the test version of the website, I don't want to pay for it. It will only visited a couple of times a month until it is in production.

Is it possible to run the database something like an access database file? I thought that some kind of functionality existed. I thought the name was SQL Server Compact Edition? But how does it works?

I also thought that you could create a free 20MB sql server database. See this link of the pricing page. Search for 20 in your browser. http://azure.microsoft.com/en-us/pricing/details/web-sites/ I don't see that option.

Any ideas would be welcome!

like image 328
LockTar Avatar asked May 10 '14 11:05

LockTar


People also ask

Is there a free version of SQL Server?

SQL Server 2019 Express is a free edition of SQL Server, ideal for development and production for desktop, web, and small server applications.

Can I use SQL Server on Azure?

Azure has the most comprehensive compliance coverage of any cloud service provider. SQL Server IaaS Agent extension provides you with the option to automate the application of storage best practices and to deploy SQL Server on Azure Virtual Machines with preconfigured security and management best practices.

Does Azure charge for SQL Server?

You are charged separately for storage, using the Premium tier of the Azure Blob Storage service, at a cost of $0.115 per GB/month. If you need point-in-time recovery, you'll pay $0.20 per GB-month. If you need long-term retention, you'll pay $0.05 per GB-month.


2 Answers

Yes, you just have to right click and include in your project.

I write an article for this in Chinese, and this is the English version I found.

Solution for free SQL Server in Azure:

  1. Install two nuget: EntityFrame.SqlServerCompact & Microsoft SQL Server Compact Edition

  2. Put SQL database file (.sdf/.mdf) in APP_Data folder

  3. Put connection string like this to use it:

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

  5. It work well and is totally free.
like image 116
Sing Avatar answered Oct 04 '22 13:10

Sing


I found the 20Mb free SQL Server option. I still had a website in my subscription that was stopped. When I deleted that, no website or database was there in my subscription anymore. I then created a new website via the custom website option in the azure portal. I then could select (in the wizard) a free 20 MB SQL Server database.

I uploaded my MVC application and the Code First created my database automatically. I don't know why the option wasn't showing up before but now it works.

like image 37
LockTar Avatar answered Oct 04 '22 13:10

LockTar