Staged Publishing on Windows Azure Web Sites
Table of Contents
The option to create multiple site slots with Standard mode sites running on Windows Azure Web Sites enables you to perform staged publishing. Staged publishing creates a staging site slot for each default production site (which now becomes a production slot) and enables you to swap these slots with no down time. Staged publishing is invaluable for the following scenarios:
Validating before deployment - After you deploy content or configuration to a staging site slot, you can validate changes before swapping these changes to production.
Building and integrating site content - You can incrementally add content updates to your staging site slot, and then swap the staging site slot into production when your updates are completed.
Rolling back a production site - If the changes swapped into production are not as you expected, you can swap the original content back to production right away.
A Windows Azure Web Sites site slot swap warms up all instances of the staging slot before the swap to production, eliminating cold starts when you deploy content. The traffic redirection is seamless, and no requests are dropped as a result of swap operations. Currently, only one site slot in addition to the default production slot is supported per Standard web site.
To Enable Staged Publishing for a Web Site
The site must be in the Standard mode to enable staged publishing.
On the Quick Start page, or in the Quick Glance section of the Dashboard page for your web site, click Enable staged publishing.
If your site is not already in Standard mode, you will receive the message You must be in the standard mode to enable staged publishing. At this point, you have the option to select Upgrade and upgrade the site on the Scale tab of your web site before continuing.
When prompted Are you sure you want to enable staged publishing for the web site '[your website name]', choose Yes.
In the list of web sites, expand the mark to the left of your web site name to reveal the staging site slot. It will have the name of your site followed by (staging).
When you select the name of the staging site slot, a page will open with a set of tabs just like any other web site. your-website-name (staging) will appear at the top of the portal page to remind you that you are viewing the staging site slot.
You can now add and update content for the staging site slot using the publish profile or deployment credentials associated with the staging site slot.
About Configuration for Staged and Production Sites
When a staging site slot is created, the configuration for the staging site slot is cloned from the production site slot by default. Configuration for all site slots is editable.
Configuration that will change on slot swap:
- General settings
- Connection strings
- Handler mappings
- Monitoring and diagnostic settings
Configuration that will not change on slot swap:
- Publishing endpoints
- Custom Domain Names
- SSL certificates and bindings
- Scale settings
Staged publishing is only available for sites in Standard mode.
If you change a site to Free mode or Shared mode, it will no longer be swappable.
Your staged site needs to be configured exactly as you want to have it in production.
To Swap the Staging Site Slot with the Production Site Slot
To swap the staging site slot to production, select the staging site slot in the web sites list and click the Swap button in the command bar.
An "Are you sure you want to swap web site deployments?" confirmation dialog will appear, reminding you of the configuration that will change and the configuration that will not change.
After you answer Yes, the site slot that was in production now becomes your staging site slot.
To swap the production site slot to staging, simply select the production site in the web site list before choosing Swap.
To Rollback a Production Site to Staging
If any errors are identified for the content or configuration swapped to production, you can simply swap the staging site slot (formerly your production site) back into production, and then make further fixes to the new version of your site while it is in staging mode.
For a rollback to be successful, the staging site slot must still contain the unaltered content and configuration of the previous production site.
To Delete a Staging Site
In the command bar at the bottom of the Windows Azure Web Sites portal page, click Delete. You will be given the option to delete both production and staging sites, or delete the staging site only.
After you answer Yes to the confirmation message, one or both sites will be deleted, depending on the option that you chose.
AutoScale is not available for non-production site slots. It is only available for production site slots.
Linked resource management is not supported for non-production site slots.
You can still publish directly to your production site slot if you wish.
Your staging slots (sites) share the same resources as your production slots (sites) and run on the same VMs. If you run stress testing on a stage slot, your production environment will experience a comparable stress load.