This is part 3 of an ongoing series on Azure for Developers, based on a set of forthcoming videos from LinkedIn Learning
In Part 2 of this series, we looked at creating an application in the Azure Portal. More common is to create your application in Visual Studio and then to deploy it to Azure. We’ll look at that now.
To begin, open Visual Studio and create a new ASP.Net Web Application.
Create an MVC application and make sure that Authentication says “No Authentication.”
Run your application locally. Once you see that it works, click on Publish
Fill in each field. Many need unique values. I make them unique by prepending with my initials. If you have more than one Azure subscription use the drop down to pick the one you want.
You may be prompted to re-enter your credentials. Use the same credentials you use to log into Azure.
Once the dialog is filled out, click Create
Azure will configure your resource group and service plan, and then it will deploy your application, opening a browser window to show you the running application.
Notice the URL, which is composed of the name you gave your application appended with azurewebsites.net. You are seeing the deployed application.
You can now modify your application locally and redeploy to Azure as you like. For example, back in Visual Studio open Views/Home/About.cshtml. Put in an H2 element, such as
<h2>This is new text!</h2>
Rebuild your application, and return to your main page. Click Publish.
Your application is published (more quickly this time) and a browser opens with the result. Click on About and see that the published application has been updated,
You have created an application in Visual Studio, published it to Azure, modified it in Visual Studio and re-published.