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.
Then it asks to create just a package file or to deploy it in azure.
If first option is selected then it creates the package file and opens the explorer.
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:
Then we have to provide deployment environment and storage account.
Whichever option we had selected, we need:
- A Windows Azure Subscription - when we sign up for azure, a subscription is associated with our live Id.
- A Windows Azure Hosted Service - we need to create a hosted service for deployment. It provides two deployment environment- production and staging.
- 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:
- We need a package file and a configuration file to deploy.
- To create a package file click publish and create package only option from project.
- Sign In the management portal.
- Create a new hosted Service if you want to deploy in a new service.
- Then in deployment environment either deploy in production or staging.
- Then start the deployment.
- You can see the progress of the deployment on the portal
- To delete a deployment first click on stop, and when it is stopped delete it.