Deploy Application to Azure DevOps

Writings for Togo
2 min readNov 13, 2022

--

This solution is friendly to all users, Windows, Mac, Linux. I will summarize it into 4 steps.

Step 1: Create sql database in Azure

  1. Go to portal.azure.com. Sign in to your account. Select Database SQL, Click Select.
  2. Specify the following attributes: Subscription (Azure for Students), Resource group (DotnetMVC), Database name (my_db), Server (you can create new server or use the old one, because one server can host many database instance). In case you create new server, enter server name, choose use SQL Authentication (record your userId and password). This id and password are used as a connection string.
UserName and password are used for connection string

3. Configure Networking, in order for end client access your database, you have to specify your networking firewall to allow end IP address. Dont change anything in this default, or you can customize in your firewall later. Click Create.

Step 2: Publish your app to Azure from Visual Studio (for Mac)

  1. Before publish to Azure. Make sure you run EntityFramework Core Migration and update the database first
  2. In Visual Studio for Mac. Right-Click to your project, then select “publish to azure”.
  3. From here you have two options, if there is a pre-created app service (which you may create from azure portal, you can publish to that instance). Otherwise, click new and fill these table as below. Notice that Resource Group is similar to database’s resource group. So, they belongs to the same resource.

Step 3: Connect app service to database

--

--