A packaged application can be deployed to the staging environment in Azure to be tested before you move it to the production environment in which the application is accessible on the Internet. The staging environment is exactly like the production environment, except that you can only access the staged application with an obfuscated URL that is generated by Azure. After you have verified that your application is working correctly, it can be deployed to the production environment by performing a Virtual IP (VIP) swap.
The steps in this article only apply to node applications hosted as an Azure Cloud Service.
This task includes the following steps:
Step 1: Stage an Application
This task covers how to stage an application by using the Windows Azure PowerShell.
When publishing a service, simply pass the -Slot parameter to the Publish-AzureServiceProject cmdlet.
Publish-AzureServiceProject -Slot staging
Log on to the Azure Management Portal and select Cloud Services. After the cloud service is created and the Staging column status has been updated to Running, click on the service name.
Select the Dashboard, and then select Staging.
Note the value in the Site URL entry to the right. The DNS name is an obfuscated internal ID that Azure generated.
Now you can verify that the application is working correctly in the staging environment by using the staging site URL.
For an upgrade scenario, in which the staged application is an upgraded version of one that has already been deployed to production, you can upgrade the application in the production environment by swapping the VIPs.
Step 2: Upgrade an Application in Production by Swapping VIPs
After you have verified the upgraded version of an application in the staging environment, you can quickly make it available in production by swapping the virtual IPs (VIPs) of the staging and production environments.
This step assumes that you have already deployed an application to production and staged the upgraded version of the application.
Log into the Azure Management Portal, click Cloud Services and then select the service name.
From the Dashboard, select Staging, and then click Swap at the bottom of the page. This opens the VIP Swap dialog.
Review the information, and then click OK. The two deployments begin updating as the staging deployment switches to production and the production deployment switches to staging.
You have successfully staged a deployment and upgraded a production deployment by swapping VIPs with the deployment in staging.