9

I am writing our Azure app to use Azure service configuration settings so we can change it in real time. I can test it by deploying and then changing them in the Azure web portal.

How do I allow changing service configuration in real time on my local azure compute emulator?

GraemeMiller
  • 11,434
  • 7
  • 52
  • 108

1 Answers1

15

In order to update the service configuration you need to modify the *.cscfg file and execute csrun.exe (in C:\Program Files\Microsoft SDKs\Windows Azure\Emulator):

csrun.exe /update:<deployment-id>;<service-configuration-file>

Note that this seems to work only when running the application without debugger.

I recently blogged about this here: Controlling your instances in the Windows Azure Compute Emulator (look under Handling the RoleEnvironment.Changing event in the emulator).

Sandrino Di Mattia
  • 24,394
  • 2
  • 55
  • 64
  • Great. Thanks for that I was totally unaware of it. Now if I could just manage to get my membership connection string stored in service configuration it would be a good week :) – GraemeMiller Aug 31 '12 at 16:07
  • Sorry for the pile-on. Is there anyway I can change value for just one key in my configuration file from my role itself? My guess is not, but I wanted to make sure of that. – Gaurav Mantri Aug 31 '12 at 16:40
  • 1
    @GraemeMiller, I wroted a detailed blog post on how you can store the connection string for your membership provider in the service configuration: http://fabriccontroller.net/blog/posts/asp-net-universal-providers-and-the-windows-azure-service-configuration/ – Sandrino Di Mattia Sep 01 '12 at 00:25
  • 1
    @GauravMantri, well you can simply change one value in the cscfg file and execute csrun.exe (even though this will use the whole cscfg file) – Sandrino Di Mattia Sep 01 '12 at 00:27
  • WOW! That is amazingly helpful. Both my major Azure issues resolved. Your blog has gone to the top of my reading list! – GraemeMiller Sep 01 '12 at 07:26