Windows Azure - Creating New Hosted Service


Introduction:


In this article we will see how to create a new Hosted service in Windows Azure portal. Hosted services are used to host our application online with the configuration files created during publishing our application. In hosted service
Microsoft has provided many options for the developers to configure based on their requirements like selecting the region where the data server can reside, selecting the environment to deploy the application and adding certificates.
Different environments are provided in Azure portal to test our application like deploying first in stage server and then deploy it in production server and to add some online certificates etc.
Lets us see how to create a storage account after we have successfully created the configuration files.

Configuration Files :


Once we have developed our application we have two ways to deploy it to the hosting services in Azure. First is the creating service package and do a manual upload to the hosting service in Azure. Second is uploading the published software directly from Visual Studio. We can have full control of the hosting service only if we go with the first option. Once we create a service package (see my first article on how to create the service package) we will get 2 files as shown below:
image
  • .cspkg file  -  Package configuration file
  • cscfg file - Service Configuration file

Steps:


Once we have created the package files, now we are in the process of publishing our application online to the cloud using the hosted service.
Now go to the management portal as shown in the screen below using the link:
http://www.microsoft.com/windowsazure/
image
Login using your Microsoft Windows Live credentials to the management portal and you will see the screen as shown in the screen below:
image
Now we can see the Hosted Service option at the Left top corner of the screen. This option will help us to configure the hosted service for our application to be available in the cloud. Click on the hosted service; a pop up will open as shown in the screen below:
image
Name of the service - For this option we need to enter the name of the service we are hosting on the server. This can be of any name as per our convenience since it's been maintained internally to identify the service.
URL Prefix : This is a very important configuration, we need to specify the application prefix as it appears as the domain specific url to be available on the cloud.
Choose Region: This option is quite open, we can select the different region of the datacenters available to deploy our application. We can use a standard region across our application usage portion so that at the time of creating the Azure connect we can create different endpoints pointing to the same location.
Deployment option: We can select to deploy our application either to a staging or production server depending on the option selected.
Package Location & Configuration file - We need to select the published files which were the result of publishing the application locally.
We can see the screen like below after making these configurations.
image
After making the above configuration, click the OK button to complete the configuration. Now we can see the publishing begining as it shows the status as shown in the screen below:
image
It might take quite some time to make the application online. We should not refresh or hit F5 to refresh the page. We can see the web role has been hosted as shown in the screen below:
image
Once the deployment is ready we can see the hosted service as shown in the screen below in the Azure portal.
image
We can see the hosted service url and the complete production path by clicking on the deployed application name as shown in the screen below:
image
Clicking on the production url will open our application on the cloud as shown in the screen below:
image

Conclusion:


In this article we have seen how to host a new service in Windows Azure portal with the different options to configure and use it on the cloud based on the requirement.