Azure Web Apps promotion by switching slots

Hi,

I’ve set up a deployment using Azure Web Apps using steps, and it works great. Currently, I have two web apps, one for Testing and one for Live, and deploy/promote the correct one by having a web app variable.

What I’d love to do is use the slots capability of Azure Web Apps, and the promotion from Test to Live would involve switching the active slot. How would I go about doing this, presumably I’ll need to do some PowerShell sorcery, but I’m not even sure of the approach, especially about running a different PowerShell script based on if it’s an initial release to a web app, vs switching between slots.

I’m not sure if I’m Octopus Deploy isn’t a good fit for this, or if it’s just the Azure integrations haven’t been built out fully yet. It seems wrong to forego the awesomeness of Azure slots to get the awesomeness of Octopus Deploy. I want all the awesomes!

Anyway, if someone could steer me onto an approach that would be great, or even better if Octopus Deploy come back and say “Yah, we’re all over that and it will be a first class feature”…

Thanks,

Paul

Hi Paul,

Thanks for reaching out. We dont have a built-in way currently to switch slots for azure webapps. It is quite easy to do so by using the cmdlet Switch-AzureWebSiteSlot though.

Lets say you have 2 slots: UAT and Production. You want everything to go through UAT first, and when you are ready just do a switch to production. On your deployment process, set the “Azure webapp deploy” step scope to UAT. Then add another Powereshell script step that runs Switch-AzureWebsiteSlot which only runs when you are deploying to production. This way, when you deploy to prod, no packages will be deployed and the only thing that will happen is the switch.

Hope that helps!

Dalmiro

Also, check Vanessa’s pointer on this thread when trying this approach http://community.octopusdeploy.com/t/azure-web-apps-deployment-slots/223/3

If anyone comes across this in the future using Azure Resource Manager (ARM) instead of Azure Service Manager (ASM) then note the commands are different and Switch-AzureWebsiteSlot will not work. See this link for more information.