1

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
6
  • does this answer your question? learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/… Commented Dec 3, 2020 at 22:26
  • @Nonik, No sir. Can you kindly guide if i have to edit the web.config file in development before deploying and also i have created the database in Azure, how do i connect it to the application as it is Codefirst Commented Dec 3, 2020 at 22:39
  • web.config is intended to be site specific, i.e. every instance of web.config could be unique. So you should never be deploying it. Commented Dec 3, 2020 at 22:58
  • @DaleK, Where do i put the connection string generated on Azure? Commented Dec 3, 2020 at 23:08
  • web.config I assume? Is that were you use it locally? Commented Dec 3, 2020 at 23:10

1 Answer 1

1

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

Database Initialization in Entity Framework 6

enter image description here

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.