In an earlier article, we saw how to create a simple Azure application. In this article, we will learn how to deploy our Azure application to the cloud, to make it a real cloud application.
In order to be able to deploy a Microsoft Windows Azure application, you will need:
- Visual Studio 2010
- Windows Azure SDK tools
- A Windows Azure account
If you have a project you created earlier following the “Creating a Simple Microsoft Windows Azure Application“, you can continue using that Visual Studio project to deploy.
If you do not have a project, you can download a pre-created solution here.
Open the “MyFirstAzureProject” in Visual Studio. Right click on MyFirstAzureProject and select Publish.
In the first phase, we will get the application packaged and ready for deployment. To do this, select “Create Service Package Only” and click “OK”.
Visual Studio will then proceed to create package. It should be created at the following path MyFirstAzureProjectbinDebugPublish.
You will notice two files in that folder.
|MyFirstAzureProject.cspkg||Package file for the Windows Azure application|
|ServiceConfiguration.cscfg||Service configuration file for the Azure application|
Deploying to the cloud
To deploy to the cloud, Login and if prompted, select to navigate to the new portal (There is a new Management portal deployed in January 2011). Select Hosted Services, Storage Account and CDN from the bottom left.
Click New Hosted Service in the top ribbon
In the popup window, fill in the details
For the package location, click browse locally and select the Deployment file created ago. Click OK to start validation of your service.
You might be greeted with a warning stating that you need more than one instance.
Go ahead and override the warning and click Yes.
You will see that the new Azure service has begun deploying to the cloud in the production environment.
After a minute, you can see that Deployment, Role and Instance are still “Initializing” and “Creating”. It can take up to 15 minutes for the application to be ready.
Once Deployment, Role and Instance display “Ready” status, your application is cloud ready.
At this time, you can navigate to the deployment node, and see the DNS name of your Azure application.
If you click on that URL, it will take you to your cloud application.
In this article, we saw how to deploy your Windows Azure application from your machine to the cloud. Hopefully, you have found the tutorial useful to you. About the author Vipul Patel is a Software Engineer currently working at Microsoft Corporation. He is currently working in the Office Communications Group and has worked in the .NET team earlier in the Base Class libraries and the Debugging and Profiling team. He can be reached at firstname.lastname@example.org