04b. Azure Deployment (App Services: Web App & API App)
We will use Visual Studio to deploy to Azure in this tutorial. This can also be done by packaging up the files and uploading manually to Azure. Or, you could do it via an automated CI/CD (Build and Release) process which will be shown in the next sections of the tutorial.
Sign up for a free Azure account here if you do not already have one or MSDN (Visual Studio Subscriber): https://azure.microsoft.com/en-us/free/ Make sure to use the same email address that you used/will use for VSTS.
-
Open the solution in Visual Studio, if it is not already opened. Login to Visual Studio with the same email address that you used to signup for your Azure account.
-
Right click on the API project and choose Publish.
-
Choose an App Service.
-
Fill in all the settings: add in a name, choose the subscription, create a new resource group. For the App Service Plan: choose a name, the closest location to you and Free. Then on the main modal click Create. If you are on the ToDoListAPI project, make sure you have API selected. If you are on the ToDoListAngular project, make sure you have Web App selected.
-
Make sure it shows up in the Azure Portal after giving it a few minutes to publish. Click on the API project to go to the overview (red arrow).
-
Copy the URL of the API App Service as highlighted in the screenshot.
-
Let's connect the front end to the API project. Open up the ToDoListAngular solution. Go to the web.config file of your front end ToDoListAngular project. Paste in the URL from the previous step.
-
Let's do the same publishing to Azure for the front end project. Repeat steps 2-5, BUT do it on the front end ToDoListAngular project. Make sure on Step 4 you choose the right option of "Web App" for the Angular Web project.
-
Verify once you are done Publishing that it is in the Azure Portal. Click on the App Service (red arrow in screenshot).
-
On the Overview page, get the URL and copy it.
-
Paste the URL into your browser and click on the Todo tab to see the Todo list. You should now have a working Azure App Service Web front end talking to an Azure App Service API which connects to Azure SQL.
Tutorial project created by Crystal Tenn and Viktor Dikov. Feel free to use this project as you wish! We just want to help others learn :)