Open fiveisprime opened 7 years ago
Could we include a scenario for flighting new releases as well? I realized last night this isn't possible from the CLI, and I think this is a pretty key scenario.
Yeah! I really just needed to get this into GitHub before switching context with some other docs I'm working through.
Here are a few other minor issues that I'd like to track as part of this:
https://github.com/Azure/azure-cli/issues/1895 https://github.com/Azure/azure-cli/issues/1867
We should also think about what the workflow looks like for apps that are using custom containers and remote Git repos (e.g. when you create the slot, how do you configure it to pull from a separate branch/container?). Maybe this already works well, I'm just not sure.
An Azure deployment slot is a live Azure Web App with its own hostname, content, and app configuration that can be swapped between two deployment slots including the production slot. This functionality allows benefits such as blue-green deployments, zero-downtime deployments, and near-automatic reverting of a deployment.
Currently, this functionality is only available from within the Azure portal and not from the az CLI limiting the options for automation and forcing users into the Azure portal. The following illustrates a straw man experience for using deployment slots from the az CLI.
North Star
Setting up a deployment slot from the az CLI should be simple and allow the same functionality as from the portal. Along with configuring the deployment slot, a new git remote should be added (similar to when creating a new web app).
Targeting a specific deployment slot should be as simple as a regular deploy since the slot was added as a separate remote.
Global Deployment Slot Option
The following use cases require that the
--slot
option be allowed globally.Streaming log access to specific deployment slots is required to maximize the utility for deployment slots via the az CLI. In general, the
--slot
should be available to existing commands including logs.Allow targeting specific deployment slots when updating environment variables.
Blue-Green Deployments
The most common scenario will be blue-green deployments where a customer will deploy to a staging slot and validate functionality before swapping the deployed changes to the production slot. This method also facilitates zero-downtime deployments where the slot is swapped immediately after becoming available.
Configuring Flighting
Configuring the percentage amount of traffic to each deployment slot is an incredibly powerful way to test changes to a production environment with very low impact. Configuring the traffic percentage then tailing logs for a deployment slot will help customers quickly test production changes.
Reverting a Deployment
In the same way that staging can be swapped in for production, customers can also perform an additional swap to revert changes. In this case, the user would deploy to the staging slot then swap for production, if the changes aren't working as intended, the user can swap production a staging again to return the web app to its original state.
How Do We Get There?
Achieving the above experience only requires some minor additions to the az CLI. Note that these additions are built upon changes that will be coming by the time //build happens (see #7).
1) Add
appservice deployment-slot
commands to the az CLI 1) Publish information about this - blog posts and how-tos