As an example, I have a hosted service with two roles, web and worker. I want to get rid of the worker role temporarily. Is there an easy way to achieve this? It would seem like something that should be trivial.
In the azure portal, if I select one of the roles and hit STOP, it stops all the roles in the hosted service. In Visual studio, I could delete the role from the “Roles” folder and republish, but then when I want to have that role start again I would have to go through the whole process of adding the role; and a seemingly unnecessary publish.
At the moment you won’t be able to do this without republishing your application. But there is an easy way to manage this in Visual Studio. You can create 2 Azure projects, one with the WorkerRole and one without the WorkerRole (note that you’ll need to duplicate everything you configure for the WebRole, like certificates, service configuration, …):
And to make this deployment process a bit easier I suggest you write a PowerShell script that does the following (for example):
Anyways, changing the number of instances to 0 would have been the perfect solution for you, but this isn’t possible at the moment. Someone of the product team confirmed that this feature would be coming, but it would only be in a release after the fall of 2012. Vote for the feature here.