Developing and Deploying ASP.NET Core and Entity Framework Core for Azure
Join the DZone community and get the full member experience.Join For Free
This post will explain an end-to-end ASP.NET Core development and deployment to Azure. Below, we've provided some introductory steps to get started. A video tutorial at the end of the article will then walk you through the rest of the process.
Clone the Sample Application
In the terminal window, cd to a working directory. Run the following commands to clone the sample app:
git clone https://github.com/azure-samples/dotnetcore-sqldb-tutorial cd dotnetcore-sqldb-tutorial
The sample project contains a basic CRUD (create-read-update-delete) app using Entity Framework Core.
Run the Application
Run the following commands to install the required packages, run database migrations, and start the application.
dotnet restore dotnet ef database update dotnet run
Navigate to http://localhost:5000 in a browser. Select the Create New link, and create a couple to-do items.
Azure Cloud Shell
To run the code in Azure Cloud Shell:
Start the Cloud Shell. Select the Copy button on a code block to copy the code. Paste the code into the Cloud Shell session. Select Enter to run the code.
Create a Production SQL Database
In this step, you will create a SQL Database in Azure. When your app is deployed to Azure, it uses this cloud database.
For SQL Database, this tutorial uses an Azure SQL Database.
Create a Resource Group
See the rest of the steps in the video:
Opinions expressed by DZone contributors are their own.