Avkash Chauhan's Blog

Windows Azure, Windows 8, Cloud Computing, Big Data and Hadoop: All together at one place.. One problem, One solution at One time...

Whats new in Windows Azure SDK 1.5 - Local and Cloud Configuration setup for your Windows Azure Application

Whats new in Windows Azure SDK 1.5 - Local and Cloud Configuration setup for your Windows Azure Application

Rate This
  • Comments 3

When you create a new application with Windows Azure SDK 1.5, you will see two separate Service Configuraiton files as below:

 

  1. ServiceConfiguration.Local.cscfg
    1. Use this file for local configuration which can be used for debugging your application in Compute Emulator
  2. ServiceConfiguration.Cloud.cscfg
    1. Use this configuration file to set your application for Windows Azure Cloud Deployment

 

You can open the Role Property Dialog to select which configuration you would want to change as below:

 

 

Once you have set the Service Configuration you can provide any desired setting. For example here in my local setting I am using Development Storage:

 

 

Following for the Cloud Configuration I am setting Windows Azure Storage credential to be used:

 

 After saving the configuration settings I can verify the changes by opening the configuration file.

 

Let’s open ServiceConfiguration.Local.cscfg and you can see we are using Development Storage:

 

<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzureProject1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*">
<Role name="TestWebRoleMVC3">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>

 

 

Let’s open ServiceConfiguration.Local.cscfg and you can see we are using Windows Azure Storage account:

 

<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzureProject1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*">
<Role name="TestWebRoleMVC3">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=teststorage;AccountKey=*************************************************==" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>


 

Leave a Comment
  • Please add 2 and 4 and type the answer here:
  • Post
  • Good improvement. But.. wasn't it possible to implement it by using existing build configurations instead?

    ServiceConfiguration.Debug.cscfg

    ServiceConfiguration.Release.cscfg

  • ..also why not to use the same xml transformation mechanism as with Web.config? ServiceConfiguration.cscf + ServiceConfiguration.Release.cscfg

  • Thanks Konstantin,

    Very good comment. I do agree with your point that even if i have one configuration file I can create multiple configuration just by copying them and then edit accordingly to my need. It was possible even before SDK 1.5 but then you will have to create new configuration by copying it, but not everyone knew about it. Having Local and Cloud configuration added through template is just a way to make multiple configurations visible..

    Thanks again!!

Page 1 of 1 (3 items)