简体   繁体   中英

Connecting SQL Server to Azure Database in ASP.NET MVC

I have been developing applications using ASP.NET MVC but using the IIS localhost for testing. I want to deploy for production now but a bit stuck.

I have subscribed for the Azure free subscription. I have been able to deploy the application to azure and it is live on "mydomain".azurewebsites.net. The issue I am having now is the database.

I want to connect a database to it. I used EF Code-First approach throughout the project. My questions are below:

  1. What will be the content of my Web.config as regards connection string before deploying the application.
  2. How do I create a database and connect it successfully to my application on Azure

You can read this article, then you will know what code-first does at runtime.

Database Initialization in Entity Framework 6

在此处输入图像描述

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM