1
votes

I have a few ARM templates and deployed those are in to azure successfully using PowerShell task through the Continuous Deployment using VSTS.

Next I created multiple environments Dev, QA, UAT, Staging and Production in Continuous Deployment. But I want the BlueGreen (Means Swap the Production environment with Staging environment and Vice-Versa) implementation in Virtual Machine for ARM templates in Staging and Production environments.

1
what do you want to swap exactly?4c74356b41

1 Answers

1
votes

Since you're saying "Web app", I'm assuming you're talking about PaaS, not IaaS virtual machines.

You don't swap anything with ARM templates. The ARM template defines what Azure resources should exist and how they should be configured. That's it.

Swapping slots can be accomplished by including the Azure App Service Manage task. You always deploy to the same slot: Staging. Then you swap staging and production.

If you're talking about IaaS, you'll have to implement your own solution to swapping. This will probably involve putting your VMs behind a load balancer service and writing a script to redirect the load balancer from one environment to the other. Another option is to swap PIPs.

Keep in mind you'll probably need to tweak your configuration files as part of this process -- assuming you have a Production SQL server and a Staging SQL server, you'll need to point to the correct SQL server as part of the swapping process.

Ultimately, there are tons of resources on the internet describing, in great depth, various approaches you can take to accomplish this and the pros/cons of those approaches. Consult those.