Azure For Developers – Part 3: Deploying from Visual Studio

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

 Select Microsoft Azure App Service and check that the radio button is set to Create New.   Click the publish button and the Create App Service dialog comes up.

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.

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET will be released early in 2025. Liberty is a Senior SW Engineer for CNH and he was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Microsoft MVP.
This entry was posted in Azure, Essentials. Bookmark the permalink.