Add staging environments using deployment slots

 

Applies To: Windows Azure Pack

In Windows Azure Pack: Web Sites, websites are deployed to the default production slot. However, when running in the Standard plan mode, you can override this behavior to use a separate deployment slot.

Deployment slots are live websites with their own host names. Website content and configurations can be swapped between two deployment slots, including the production slot. Swapping moves the website in the deployment slot to the production slot and vice versa. Some configuration settings are moved with the swap (see the Configuration settings that are swapped section below).

Deployment slots have the following benefits:

  • You can validate website changes in a staging deployment slot before swapping it with the production slot.

  • You can eliminate downtime by warming up a website in a deployment slot before swapping it into production. The traffic redirection is seamless and no requests are dropped as a result of swap operations. If preswap validation is not needed, the entire workflow can be automated by configuringAuto Swap.

  • If the changes swapped into the production slot are not as you expected, you can perform the same swap immediately to switch back to your previous production website.

Add a deployment slot to a website

The website must be running in the Standard or Premium mode for you to enable multiple deployment slots.

  1. In the management portal for tenants, select your site.

  2. On the Quick Start screen, click Add a new deployment slot.

    If the website is not already in the Reserved mode, you will see a message listing the supported modes for enabling staged publishing. At this point, you have the option to select Upgrade and navigate to the Scale tab of your website before you continue.

  3. In the Add a new deployment slot blade, enter a name for the slot.

  4. Select whether to clone a website configuration from an existing deployment slot. If you haven’t yet created a deployment slot, you can only clone the default production slot. You can also change the slot's configuration later.

  5. Click the check mark to continue

  6. In the Web sites list, click the deployment slot to open the website details, such as metrics and configuration information.

  7. Click the Browse button at the base of the website listing. Notice that the deployment slot has its own host name and is also listed as a live app.

Adding a deployment slot does not create content for that slot. You can deploy content to the slot from any repository or repository branch. Use the publish profile or deployment credentials associated with the deployment slot for content updates. For example, you can publish to the slot by using Git. For more information, see Continuous deployment using Git in Azure App Service.

Swap deployment slots

To swap deployment slots, follow these steps:

  1. Click the Swap button in the command bar of the website or in the command bar of a deployment slot. Make sure that the swap Source and swap Destination are set properly. Usually, the swap target is the production slot.

  2. Click the check mark to complete the swap.

Roll back production app after swap

If any errors are identified in production after a slot swap, you can roll back the slots to their previous states by swapping the same two slots.

Delete deployment slot

To delete a deployment slot, follow these steps:

  1. Navigate to the website's Quick Start screen for the deployment slot that you want to delete.

  2. Click Delete and then click Delete slot (your slot) only.