ScottGu recently (yesterday) announced the staged publishing support for Windows AzureWebsites. The concept of staging deployment is not new in Azure world, we have this support from long time for Cloud Services. In Cloud Services, we can simply make a staging deployment and then test it thoroughly to ensure the integrity and new features of new version, once we test the staging deployment we can simply make a swap between staging and production versions. Thus we get new features and changes included in new version into production with a single button click.
AzureWebsites now support staged publishing along with production swap. Unlike to cloud services where the DNS will be swapped across deployments, in AzureWebsites content of the staging will be swapped with production.
To get started create a AzureWebsite and in Dashboard we can find “Enable Staged Publishing” as shown below.

Presently AzureWeebsites staged publishing supports only for Standard mode websites. So enabling the staged publishing will prompt for upgrading free/shared websites to standard mode.

On clicking Upgrade, Management portal will take us to Scale tab of the website.

Once Website has been scaled to Standard mode. We can go back and click Enable Staged publishing on dashboard. It will prompt for confirmation, Click Yes.

A staged version of website will be created as shown below.

Now lets browse the actual site at jash.azurewbesites.net. It displays default home page for AzureWbsites, because we never deployed any content to this site so far.

Lets create a simple Visual Studio 2013 MVC5 project.

Download the publish settings for the staging site, by clicking Download publishsettings as shown below.

Right click Visual Studio project and select publish. Click on Import and browse the publishsettings file we just downloaded.

Click ok, navigate to Preview tab and click on Publish. Once done, we have following version of site at jash-staging.azurewebsites.net

Once we test the application in staging url, we can swap the content from staging to production as shown below.

That will display the following confirmation.

click ok. It will take matter of seconds to minutes for swapping the content between the production and staging areas. Once completed, we can browse the production site and see all our changes from staging reflecting in production.
Swapping only changes the configuration related to following -
- General Settings
- Connection String
- Handler Mappings
- Monitoring and Diagnostic Settings
Rest all configuration will be intact for both the sites.

If we visit stating URL, then we will content swapped with production as shown below.

Staging site always helps us to be more productive when it comes to business continuity and User acceptance testing. I hope this feature will be more enhanced in future and extended to free and shared modes. Happy Coding!!!






Pingback: TechNet Blogs()