Let us say, that our services are running fine on Azure. After sometime, we need to make changes and upgrade the services which are already running. Here comes the tricky part, sometimes upgrading would go smooth and sometimes you won’t know what is causing the problem. Windows Azure has tried to address these issues.
The application code can be updated easily in Azure management portal. You will need a service package (.cspkg) and service configuration files (.cscfg) before moving ahead.
Step 1 − Login to the management portal.
Step 2 − Go to the service you want to update.
Step 3 − Click ‘Instances’ from the top menu and then click ‘update’. The following screen will pop up.
Step 4 − Enter the deployment label name and upload .cspkg and .cscfg files.
Step 5 − Select the role you want to update or select ‘all’ if want to update all roles.
Step 6 − Check the checkbox as required and click the ‘Arrow’ on the right side.
You might come across a scenario, when you need to make changes to the architecture of service. Azure provisions a way which can handle the upgrading easily. There are two deployment environments - production and staging. Let’s assume that your service is at production, but you can deploy the new version in the staging environment. After that you just test it and if everything is fine, you swap it with the production deployment. Behind the scene, the virtual IPs of production and staging deployment are swapped, hence staging becomes production and production becomes staging. While the swapping happens, the service is not interrupted. All this is done with no downtime for service. It also makes it easy to rollback to older production version in case you need to do it.
Step 1 − Login to the management portal.
Step 2 − Go to the service. Select ‘Instances’ from the top menu. You can see in the following screen, two instances are there for this service.
Step 3 − When you have deployed the service in staging and production you will see that ‘Swap’ at that bottom of the screen is activated. You just have to click that Swap icon and it will be done.