2
votes

Are there any patterns for deploying and upgrading Azure Worker Roles. We are currently using our CI Server to deploy our worker role to Staging and then to Swap to Production.

Is it possible to prevent the Staging role from accessing resources (ServiceBus, DB, etc.) so that it isn't processing jobs until it is promoted to Production.

2

2 Answers

1
votes

The most common pattern is to have a configuration setting that you would change when you swapped to production. The worker role code would only do work if that configuration setting had a certain value.

But for a worker role that does background work would it matter if both staging and production were picking up jobs? There are a lot of scenarios where it does matter, but typically for background worker roles that are backwards compatible it doesn't matter which one picks up the work.

0
votes

You don't. They both will work on the same storage until you first swap the deployments and then stop the older one. You should handle multiple instances working over the same storage anyway so this shouldn't be a big deal to prevent them from processing the same items in the storage.