How to publish a MVC 5 app built using database-first approach to Azure?

KPS 1 Reputation point
2022-10-23T18:49:48.247+00:00

I followed the tutorial for "Getting Started with Entity Framework 6 Database First Using MVC 5" and after publishing the app to Azure have not been able to get it to connect to the database.

Are there any tutorials that would explain how to publish a web app which is built using the database-first approach?

Developer technologies ASP.NET Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Takahito Iwasa 4,851 Reputation points MVP Volunteer Moderator
    2022-10-23T21:27:50.473+00:00

    Hi, @KPS

    i couldn't find a tutorial.

    If it's database first, you already have a database, right?
    First you need to decide where to host your web application and database.

    Do you want to deploy a new web application?
    You can deploy to Azure in the same way as the code-first approach. However, no migration operation is required.

    Don't have your database hosted in Azure yet?
    With the database-first approach, you first need to prepare the database that your web application will use.
    Whether using DDL scripts or using backup files, there are a number of strategies for hosting databases in Azure.

    Common to all of the above are:

    • you can deploy the web application normally
    • Prepare the database referenced by the web application
    • Make the connection string of the web application that of the prepared database

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.