Quantcast
Channel: Robert Marshall - MVP's Activities
Viewing all articles
Browse latest Browse all 154

Checking out Visual Studio 2015 and Azure integration

$
0
0

I’ve been looking at Azure Services for hosting an ASP.NET Application, and wanted to get an understanding of how to set this stuff up. I’m relatively new to wiring things up in Azure, and thought it’d be a good idea to log what I needed to do while going about getting Visual Studio publishing into Azure. Here’s how I did it.

 

I originally set this up last night on my main development machine, my recollection of the steps is a bit hazy so I spun up a Windows 10 VM this morning and reproduced the install there.

 

Okay, to setup your Platform for Development of an ASP.NET Application hosted in Azure you’ll need the following … and once you’ve got this lot in place, I’ll briefly run through publishing a project to Azure:

 

  • An Azure account, if you don’t already have one then register for a trial here:

 

image

image

 

  • Visual Studio, Azure SDK and Azure Tools, you have two options here,

 

    • Option 1– Do the individual installs of Visual Studio and the Azure SDK which includes the Azure Tools (2.7 as of writing):

 

      • Download Visual Studio 2015 Community (or use Enterprise if you already have), install it:

 

image

Click Above to download Visual Studio Community

 

Choose these options when installing

 

image

image

image

This bit will take a long time, go get a Tea\Coffee and\or browse around here for a bit

 

      • Install Azure SDK for .NET using Visual Studio 2015 by opening Visual Studio, proceed to Select File \ New \ Project, assuming you are using Visual C# expand Installed \ Templates \ Visual C# and Select Cloud, Select Get Microsoft Azure SDK for .Net (See below screenshot) and Select OK, work your way through the process:

 

image

 

image

 

image

 

 

image

 

  Another long install period stands before you, your options are limited to staring at progress bars or going off to do something else

 

if staring at a progress bar is your kind of thing, stick around, otherwise why not check out some stuff about MVC

 

image 

 

    • Option 2– Download Visual Studio 2015 Community, the Azure SDK with Azure Tools in one bundle:

 

image

 

Now that you have Visual Studio 2015 Community and the Azure SDK installed, and you’ve got yourself a brand new shiny Azure Trial account, let’s see how easily and quickly it can be integrated, and an Application published to the world.

 

  • Open Visual Studio 2015

 

  • Connect to Azure by clicking the Cog\Wheel icon

 

image

  • Click the account box

image

  • Click Add an account and enter the account you used to create the Azure trial

 

  • Click Apply to associate the accounts Azure subscription with Visual Studio

 

image

 

  • Select File \ New \ Project (or click New Project… on the Start Page)

 

  • Select Installed \ Templates \ Visual C# \ Cloud and then Select ASP.NET Web Application

 

  • Keep Application Insights ticked, and keep Send telemetry to set to New Application Insights resource

 

  • You should see your Azure account listed on the right hand side as in the shot below

 

image

 

  • Select OK

 

 

image

 

  • Select Change Authentication

 

image

 

  • Select No Authentication and Select OK

 

  • Select OK

 

  • Now you’ll need to configure Azure to receive the Application, create a suitable Web App Name or use the default given, create a new App Service Plan, a new Resource Group and select the Region you want to be served from, select No database as we’re not going to use one in the following steps

 

image

 

  • Select OK

 

image

 

  • We’re almost there, the projects been built and we can upload it to Azure. Right click WebApplication1 in the Solution Explorer and Select Publish

 

image

 

  • The Publish Web wizard will pop up with all the fields pre-populated for you, just need to Select Publish to get things going

 

image

(I’ve blanked User name, your dialog will show a unique user name)

 

  • In the Output Window you’ll see the news that the Publish Succeeded

 

image 

 

  • Now you just need to visit the link at the bottom of the Output Window, and you’ll be staring at the Website running in the Azure Cloud. How cool is that.

 

image

 

  • Once you’ve made changes to the project, save it then Publish it again using the same method described above, it is that simple and shows off the tight integration going on with the Studio and Azure

 

  • Let’s change some code and republish the project, from the Visual Studio editor find the Solution Explorer, scroll down and find Default.aspx, right click it and Select View Designer

 

  • Put your cursor over the end of the ASP.NET H1 tag and replace the text to something new

 

image

 

  • Here’s mine changed

 

image

 

  • Publish the Project again, and the Publish Web wizard just needs a single click on Publish to get underway

 

image

 

  • Refreshing the web page in the browser shows the change instantly

 

image

 

There we are, Azure integrated with Visual Studio and a project for a Web Application published and made live globally, easily, quickly (aside from the installs!), quite a lot of moving parts involved, done very well.

 

Now you have a development lab linked to Azure from which you can do all kinds of things from, especially useful for learning how to write something webby while grasping at the tools for the first time :-)

 

There’s a few other features that show off integration with the Cloud and Visual Studio that you might find useful, or inclined to spend time checking out, Visual Studio Online and GIT extensions for Visual Studio

 

image

 

image


Viewing all articles
Browse latest Browse all 154

Trending Articles