.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> Azure >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Multiple Service Configurations For Azure in VS2010 in Windows Azure

Posted By:Karthikeyan Anbarasan       Posted Date: August 07, 2011    Points: 200    Category: Azure    URL: http://www.dotnetspark.com  

In this article we are going to see how to use the new Multiple Service Configuration in Windows Azure using Visual Studio 2010
 

Introduction:

In this article we are going to see how to use the new Multiple Service Configuration in Windows Azure using Visual Studio 2010.

Overview:

In our earlier article we have seen the latest release of the Azure tools V1.4 for Visual Studio 2010, Now in this article we are going to see one of the new feature Multiple Service Configuration. As the name suggests itself, we can have Multiple Service Configuration files for an Azure ASP.Net application and use it across the environment. This feature is very much effective to reduce time-consuming when deploying our application to the cloud like changing the configuration files and then deploying it to the cloud.

Steps:

This feature provides 2 set of configuration files as below

  • ServiceConfiguration.Local.cscfg - Can use it locally for debugging
  • ServiceConfiguration.Cloud.cscfg - Can use it remotely in cloud when publishing

Let us see the step by step process on how to use these 2 configuration files in our Azure Application when using it locally and when deploying to the cloud.

Open Visual Studio 2010 IDE in administrator mode and go to File -> New -> Project as shown in the screen below.

image

Now select Cloud template from the left Menu and select Windows Azure Project as shown in the screen below. Also provide a valid user-friendly name and the location to store the application and click on OK button to proceed further.

image

Now we need to select ASP.Net Web Role from the role list as shown in the screen below and click on OK button to proceed further.

image

Now the project will be opened and we can see 2 configuration files created named as below

  • ServiceConfiguration.Local.cscfg
  • ServiceConfiguration.Cloud.cscfg

image

Now right click on the Azure project and select properties as shown in the screen below

image

Now the properties window will be opened, in the property window we can see the different options to be changed based on our configuration file selection and our requirement as shown in the screen below.

image

Now for checking the sample, we have selected Cloud from the Service Configuration drop down and keep the options standard as shown in the screen below.

image

Now select Local from the Service Configuration and increase the Instance Count to 2 just to check the configuration files created as shown in the screen below.

image

Now let us open both the configuration files (Local and Cloud) and we can see the instance count varies as shown in the screens below.

Cloud Configuration File:

image

Local Configuration File:

image

Now we can directly click the debug button or press F5 to build and debug the application as shown in the screen below.

image

Now when we try to publish the application to the cloud we can see the setting changes. Right click on the application and select Publish as shown in the screen below to publish our application to cloud.

image

We can see a new Publish Setting window to do the configuration changes as per our requirement to deploy it to the cloud as shown in the screen below.

image

In the Service Configuration drop down we can select which configuration we need to upload to the server. We can select Cloud or Local so that the respective configuration will be deployed to the server as shown in the screen below.

image

Conclusion:

So in this article we have seen the Multiple Service Configuration feature introduced in Windows Azure tools V1.4 for Visual Studio 2010.


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend