Deploying Azure Applications to the Cloud

Posted by virtualization.info Staff   |   Monday, August 17th, 2015

This is a guest post by Debra Shinder.

So you have a Windows Azure application and you’re ready to deploy it to the cloud – but you’re not quite sure of how to go about it? There are a couple of different methods that you can use, but the easiest way for a beginner is to using the Windows Azure Web Portal. Once you’re more familiar with the process, you can use the Azure Management API to automate the process and make it more efficient.

The first step is to package the application and configuration files into a .cspkg file. If you created your application using Visual Studio for Azure, just right click the project and select “Package.”

If you aren’t using Visual Studio, the “do it yourself” method requires you to get the cspack tool from the Azure SDK and use the command line to create the package. There are a number of options available but the tool’s syntax is relatively simple. You must run the cspack command with the parameters that are appropriate for your application (for example, a web role).

To run cspack, you need to open the Windows Azure SDK command prompt and run as an administrator. For more information on how to use cspack to package the file, see the MSDN web site.

This process will create a .cspkg file with the default name ServiceDefintionFileName.cspkg and a .csfg file with the default name of ServiceConfiguration.csfg. You can specify a different name. If you’re using cspack to create the package, the /out option is used to specify the name.

Now you’re ready to start the deployment process through the web portal. Once you have the package, log onto the Windows Azure web portal with your Azure account and select “New Hosted Service” from the ribbon at the top left of the page. You’ll need to enter a name for the service and a unique URL prefix. Select your region (closest for best performance) and accept the default deployment options. Type in a name to identify the deployment.

For the “Package Location” field, click the Browse locally or Browse Storage button (depending on what the .cspkg file that you created above is stored) and then navigate to the location of the file and select it. Do the same for the ServiceConfiguration.csfg file that was created. Now click OK.

If all goes well, the application will be successfully deployed. However, you might run into a slight complication: a “warning has been encountered” message. This happens when your deployment is running only one instance per role. The idea is to ensure that applications running on Azure are reliable and there is always an instance available, so that means at least two instances should be running. You can override the warning and submit by clicking “Yes” on the warning dialog box, or you can start additional instances. The down side of running additional instances is, of course, that you will be charged for them.

Once you get past the warning issue, the status column should show your new deployment as “Ready.” Now you can select the deployment and click on it to see its properties in the Properties pane. The application should run in whichever web browser you have configured to be the default.

Note that there are some situations where you will need to do some special configuration before deploying your application. If your application will use SSL encryption, you’ll need to configure it for that. There are several steps, including obtaining an SSL certificateand adding it to Windows Azure, updating the service definition file and configuring the HTTPS endpoint. See the detailed instructions here.

Also, if you want to configure Remote Desktop Connections to role instances, you’ll need to set that up to prepare the service definition file for remote access. You can find the instructions for doing that here.

For more great tips on using the Azure cloud, check out CloudComputingAdmin at www.cloudcomputingadmin.com