4

I have an Azure Cloud Service. One of the Web Role contains a configuration which I need to change its value every few days.

Each time when I change the value, Azure takes about 10~15 min to finish the procedure. Which make me quite confusing, since what I've changed is just a configuration value.

So I'm wondering what does Azure do in the background that make it so slow?

3
  • What is the nature of the config value, and how is it used? It sounds like config values are not the right storage mechanism for this value. Jul 29, 2015 at 2:57
  • It's an api key that need to update every few days. Maybe you are right. I should put the key in azure storage instead of putting it in configuration. But still I don't understand why Azure takes so long to update the configuration.
    – huangcd
    Jul 29, 2015 at 3:15
  • Added an answer to this question. As an aside, is there any particular reason to run this as a cloud service? A web app would allow this configuration to be changed without the downtime experienced. Jul 29, 2015 at 3:17

3 Answers 3

5

See the following documentation: Use the RoleEnvironment.Changing Event

In summary, if your role does not handle the RoleEnvironment.Changing event, the instance is taken offline, the updated configuration value is applied, and then the instance is brought back online

Therefore, you may want to handle this event, and respond to the configuration change so that the instance isn't restarted.

1
  • Thanks Brendan, it's exactly what I'm looking for.
    – huangcd
    Jul 29, 2015 at 3:20
2

Note: this should be a comment on the accepted answer but I'm apparently not allowed to post them yet ...

While this seems to work for single instance deployments, I find that if I deploy 2 or more instances, Azure still restarts them one by one.

In the portal they change from "unknown" to "busy" before eventually coming online so I assume that's what it's doing. And of course this takes way longer than it should.

There's nothing in the documentation that talks about this behaviour however, which I find odd.

0

Your instances are being restarted. There is a dated but good and relevant writeup by Steven Nagy here: http://www.codeproject.com/Articles/63977/Windows-Azure-Development-Deep-Dive-Working-With-C

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.