Right way to create staging and Prod environment in Azure
A

1

6

We want to create two environments on Azure. These two environments will be used as Staging and Production, but we want to be able swap between them very easily, so staging can act like prod and vice versa. These two environments will contain Azure App services (Web App, API App and logic app).

What is the best practice to create these two environment? Do we need to have two subscriptions, or two resource groups? appreciate all kind of advice.

Aboutship answered 3/2, 2017 at 9:37 Comment(0)
P
3

Well, in that case I believe you should use Slots for the WebApp as it is meant for that exact purpose.
So you create a WebApp and create staging slots, swap is virtually instantaneous, you can configure slots to get code from different branches, you can have slot settings and so on.

So you don't need another subscription or another resource group.

As for your additional question: there are SLOT specific settings, you assign them to SLOTS, not to version of your APP, so if you have a PROD SLOT connection string and STAGIN SLOT connection string, when you do a swap SLOT SETTINGS STAY IN THE SAME PLACE, its the APPS that are swapped. TL/DR: it does exactly what you want.

Periderm answered 3/2, 2017 at 9:41 Comment(4)
Thanks, these environments have different configurations. How can I change configuratinos automatically, when I swap between Slots?Aboutship
You can mark settings and connection string as slot-specific. This makes that particular setting "sticky" to the slot it is on, so it won't change. Without marking them they will all swap with the app.Wira
@Aboutship check the article I've linkedPeriderm
I have read the article. I have still something that I cannot understand. My staging and PROD have different configuration settings (e.g. API endpoints to communicate). My requirement is: I release to staging and test the code against staging endpoints when I swap from staging to PROD, The Prod must be staging (using same endpoints as staging before swap) and the staging must act like PROD (using Prod endpoints as PROD used before swapping).Aboutship

© 2022 - 2024 — McMap. All rights reserved.