Developing and Deploying your First Windows Azure Application


Introduction:

In this article we are going to see how to develop an application using Windows Azure tools and host the application in the cloud. There are many blogs showing a basic idea of the steps to create an application and host it online in the Azure portal. I am giving my steps of how to do it my way of putting things together.

Overview:

Before we start developing the Azure application we need to check some pre-requisites in order to develop the application. We need to have an Azure pass for the management portal; we can request the pass using the following link:

http://windowsazurepass.com/

Once we get access to the Management portal we need to download the SDK for Azure using the following link:

http://www.microsoft.com/windowsazure/sdk/

Once we have downloaded and installed the required SDK and have access to the management portal we are set to start with our development of the first Azure sample.

Steps:

Now open Visual Studio 2010 in administrator mode (right click and select Run as Administrator) to open the IDE. Once the IDE is opened now navigate to File -> New Project -> and select the Cloud tab in the left side menu. You can see the Windows Azure project template as shown in the following screen:

Azure1.png

Now give the application name and select the desired location and click ok. It will open a windows as shown in the following screen:

Azure2.png

Here we can see some various roles provided by the Azure templates. These are the roles available and used as needed. The most frequently used are as follows:
  • Web Role - Basically a web application like an ASP.NET application.
  • Worker Role -Similar in behavior to a traditional Windows service application, that it runs behind the scenes.
  • VM Role - To get some configuration and maintenance related stuff from the OS in the cloud.
In our sample we are going to only see the Web Role, so we will restrict out concentration to that. Now select the Web Role and click on the ok button. In your Solution Explorer the IDE will be as shown below:

Azure3.png

This screen is your start up application web page. We can do our changes as per the requirement and publish it online in the cloud. In our example we have changed some small stuff as shown in the following screen:

Azure4.png

Now Press F5 to build and execute the application to see the sample result locally before publishing it to the cloud. We can see some emulators loaded and we can see the status at the bottom of the page as shown in the following screen:

Azure5.png

These emulators are used to process the web role as an Azure product. Now we can see the desired result locally as shown in the screen below:

Azure6.png

Now we have some fabric controls running at the background to get the process executed. To see that, we can go to the task bar and we can see the task running as shown in the screen below:

Azure7.png

We can select the required emulator UI to check the process and do some manipulations like viewing the status and logs in the deployment process and do a complete maintenance of the deployment as shown in the screen below:

Azure8.png

Azure9.png

So once we are done with our process we are now ready to deploy the application to the Azure cloud. For the deployment process to be followed we need to start with publishing the application to the cloud. Before doing that we need to login to the management portal using the following link:

http://www.microsoft.com/windowsazure/

We can see a screen like below. Select the Sign into Management portal at the top right corner:

Azure10.png

After selecting that sign in to management portal you will be asked for the Username and Password to authenticate the process as shown in the following screen:

Azure11.png

Once we have given the correct credentials and then click on the submit button it will navigate to the main screen of the portal as shown in the following screen:

Azure12.png

This is the new management portal developed using Silverlight by Microsoft. This portal provides complete accessibility to do all the manipulations of the application.

Now that we are all set to publish the application, we have some process in publishing the application like we can create service files and upload them to the server. When we do a publish we will get files as shown below. To do that right-click on the web application project in the Solution Explorer from the IDE as shown in the following screen:

Azure13.png

Now select the Publish option and we can see the configuration window as shown in the following screen:

Azure14.png

Here we have 2 options to publish the application; we can either directly publish the application online or we can create just a service package and manually do an online upload. Let's select the first option which is ""Create Service Package Only" as shown in the following screen, then click on OK.

Azure15.png

Now we can see the publishing process has started and we can see the active comments at the bottom in the Output screen as shown in the following screen:

Azure16.png

Once the publishing has completed you will see the result as shown in the following screen:

Azure17.png

Now a folder will be opened as publish with the 2 configuration files as shown in the following screen:

Azure18.png

Now we are all set with the Azure project to be published online using the configuration files. Now move to the management portal and do the following. Select New Hosted Service as shown in the following screen:

Azure19.png

We need to do the configuration as shown in the following screen:

Azure20.png

Here we need to give the path for the configuration file and the package file locations we got from publishing the application. You will see a warning as shown in the following screen. We can just ignore that warning and click on the OK button.

Azure21.png
 

Now we can see the services getting published and started as shown in the screen below:

Azure22.png

The process will take some time to proceed since it is uploading the configuration and creating the application online. We should not refresh the page until the process has completed.

Once the process has completed we can see the screen as shown in the following screen.

Azure23.png

Now the process is hosted online in the cloud and we are ready to access the site online. Now click on the Appication Name F5debug and we can see the DNS name and the URL to access the application as shown in the screen below:

Azure24.png

Now click on the url http://f5debug.cloudapp.net/; that will open our application in the cloud as shown in the screen below:

Azure25.png

We can administer the application online in the portal using the following options available in the portal as shown in the screen below:

Azure26.png

We can delete this service using the stop button and then create a new service since in the evaluation process that Microsoft provides we can create only one service at a time.

Conclusion:

So in this article we have seen the basics of how to create an Azure application using Visual Studio 2010, create service packages and publish in the Azure portal.