How to deploy application in Windows Azure


In the previous article we have seen how to create a Hello World application in azure. In this article we will see how to deploy it in Windows azure. To deploy an application in azure, two files are needed- a package file and a configuration file. Configuration file is already in CloudService1 named ServiceConfiguration.cscfg. Now for the package file just right click on the CloudService project and click Publish.

DeploymentInAzure1.gif
 
Then it asks to create just a package file or to deploy it in azure. 

DeploymentInAzure2.gif
 
If first option is selected then it creates the package file and opens the explorer.

DeploymentInAzure3.gif
 
Once we have a package file (.cspkg) and configuration file (.cscfg) then we can deploy it through management portal, or azure service management cmdlets, or Cerebrata's CloudStorageStudio, or Cerebrata's Azure management cmdlets. We can directly upload it through visual studio also, if we select second option from publish dialog. It needs a subscriptionId and a X509 v3 certificate as shown below:

DeploymentInAzure4.gif
 
Then we have to provide deployment environment and storage account.

Whichever option we had selected, we need:
  1. A Windows Azure Subscription - when we sign up for azure, a subscription is associated with our live Id.
  2. A Windows Azure Hosted Service - we need to create a hosted service for deployment. It provides two deployment environment- production and staging.
  3. A Windows Azure storage account - When we deploy through visual studio then package file is first uploaded in blob storage of the storage account, and then deployed from the blob service.
So summarizing deployment through management portal in some simple steps:
  1. We need a package file and a configuration file to deploy.
  2. To create a package file click publish and create package only option from project.
  3. Sign In the management portal.
  4. Create a new hosted Service if you want to deploy in a new service.
  5. Then in deployment environment either deploy in production or staging.
  6. Then start the deployment.
  7. You can see the progress of the deployment on the portal
  8. To delete a deployment first click on stop, and when it is stopped delete it.


Similar Articles