We will look at some environment management options
for our new site. Right now our site is
in development mode, the development app service options are good for proof of
concept or basic testing. In order to
move our site beyond the early development we will upgrade our app service plan
to a production level plan. This will
give us some key features that we want to examine.
For our
purposes we will upgrade to the lowest level.
The first feature of our production app service plan that we want to
examine is deployment slots. Deployment
slots provide a number of key advantages.
·
You
can validate app changes in a staging deployment slot before swapping it with
the production slot.
·
Deploying
an app to a slot first and swapping it into production makes sure that all
instances of the slot are warmed up before being swapped into production. This
eliminates downtime when you deploy your app. The traffic redirection is
seamless, and no requests are dropped because of swap operations. This entire
workflow can be automated by configuring auto swap when pre-swap validation
isn't needed.
·
After
a swap, the slot with previously staged app now has the previous production
app. If the changes swapped into the production slot aren't as you expect, you
can perform the same swap immediately to get your "last known good
site" back. This is amazing helpful when you are first starting out.
More specifics on deployment slots can be found here.
We are going to create a new slot that we will call “Stage”. One of the powerful features of slots is the
ability to clone settings from one environment to another. This can be connection strings, API endpoints etc.
To setup configuration variables that will be shared between slots
go to the configuration link under settings on the left hand panel. This will bring up the add appsettings
panel. There are two sections to this
dialog one for general appsettings (end points etc), and a second for connection strings. The important thing to note here is the
“Deployment slot setting” check
box. Selecting this box causes the
setting to be cloned when a new slot is created. Be sure when you create the new environment that
you check the value of your new slots settings.
Failure to do this may result in your new environment pointing at
the wrong database instance.
After setting up your end point setting create your new slot by selecting create a new slot. The dialog is as appears below.
Once the environment is created you can navigate between the
environments from the development slots tab. Any settings that you have selected as a
development slot setting will be cloned when you create the new slot.
Comments
Post a Comment