As mentioned in the previous chapter, the Windows azure platform provides two deployment environments for each hosted service: the staging environment and the production environment.
This chapter describes how to create a site in the transition environment and switch to the production environment through VIP swap.
1. Create a Windows azure Project
Create a Windows azure project and right-click "package". For details, refer to Windows azure platform (10) to deploy the local azure project on the cloud server.
2. Create a managed service in Windows azure
Open your browser and go to the Windows azure user management interface. Click create managed service"
In the pop-up "New managed service", make the following settings:
In this way, a hosting service located in the Hong Kong data center has been created.
3. Deploy the transitional environment
Select the new managed service and select "new transitional deployment"
In the displayed "new deployment" window, enter the deployment name and upload the cspkg and cscfg files.
A warning window is displayed when you click "OK" to start deployment. This is because the current ASP. Net only sets one instance and cannot get the high availability of Windows azure 99.95%. Click "yes" Here to ignore the warning and continue deployment.
After the upload is complete, the deployment status is constantly updated on the main interface.
The application status changes to "ready" until the deployment is complete, indicating that the ApplicationProgramIt has been successfully deployed on the Windows azure platform and started.
We can observe that the DNS name shows the domain name corresponding to this hosted service in the staging environment. Because we created a transitional deployment (staging), the domain name is composed of guid.
4. Transition to the production environment
The staging environment of Windows Azure is mainly used for testing. Its URL is related to the deployment ID, so it is not very good. We can switch the staging deployment to the production deployment through the VIP swap function.
Select the previous deployment site and click the swap VIP button in the toolbar.
The displayed Confirmation window lists the information about the hosted service to be switched. You only need to select "OK.
Then the managed service is updated:
The operation will be completed within one minute. Then we can see that our site is in the production environment. The response URL is also set.