SALES: 1-800-867-1380

Packaging and Deploying an Application to Azure

Updated: January 29, 2015

Authors: Larry Franks, Rama Ramani

This document provides guidance on deploying an application to an Azure hosted service. It also provides guidance on working with other Azure services that your application may use, such as Microsoft Azure SQL Database and Azure Storage.

Before deploying an application to Azure, you should have an understanding of the following:

  • Differences between the Azure Emulator and Azure, Azure SQL Database, and Azure Storage

  • How to configure:

    • Connection strings for Azure Storage Services and Azure SQL Database

    • Endpoints

    • Role size

    • Number of instances

  • How to create an affinity group

  • Microsoft service-level agreement (SLA) requirements for hosted services

  • Development and production environments for hosted services

  • How to deploy an application using the Azure Management Portal

The Azure SDK installs the Azure Emulator, which emulates the Azure hosting and Storage services. Before deploying an application to Azure, you should first perform testing in the Azure Emulator. While the emulator provides an easy way to test a hosted application during development, it cannot fully emulate all aspects of the Azure platform. For example, the connection string used to connect to Azure Storage differs between the Azure Emulator and Azure. Before deploying an application to Azure, you should understand the differences between the emulator and Azure and ensure that your application does not rely on a behavior of the emulator that is not present in the Azure environment.

For more information on the differences between the emulator and the Azure platform, see Overview of the Azure SDK Tools.

While the Azure Emulator provides a local testing solution for hosted services and storage, it does not provide any development equivalent for all services provided by the Azure Platform. The emulator supports caching; see About In-Role Cache for Azure Cache. Additionally, In-Role Cache integrates with Visual Studio to make it easy to add Cache to your application. There is also full fidelity with the compute emulator for debugging your application before deployment.

For database design and testing, you can use SQL Server; however there are differences between SQL Server and Azure SQL Database that you must be aware of. For a comparison, see Compare SQL Server with Azure SQL Database.

If your solution is developed against SQL Server, you should consider whether you will recreate your databases and associated artifacts in Azure SQL Database or migrate your SQL Server development environment to Azure SQL Database. For information on migration options, see Migrating Databases to Azure SQL Database.

For other services, you must develop against the live Azure service. Currently, Service Bus does not work with Azure emulator. You have the option to use Service Bus server; see Test Azure Service Bus locally without any subscription or login.

The following items should be verified before deploying an application to Azure:


Item to check Description

Number of instances

At least two instances must be created to meet the Azure Compute Service Level Agreement (SLA) requirements. For more information on Azure SLAs, see Service Level Agreements.

Connection strings

All connection strings should be checked to ensure they do not reference development storage

Virtual machine size

The virtual machine size governs available memory, local storage, processor cores, and bandwidth for your application. For more information, see How to Configure Virtual Machine Sizes.


Endpoints determine the ports used for communications with your hosted services, and whether the port is public or for internal use only.

Affinity group

To ensure that you are deploying to the correct datacenter, you should consider creating an affinity group for your project and use this when provisioning services or deploying to the Azure platform. If you do not use an affinity group, you may accidentally deploy services to different datacenters, which can impact performance and increase costs.


If you wish to enable SSL communications, or remote desktop functionality for your hosted service, you must obtain and deploy a certificate to Azure. For more information, see How to Add a Certificate to the Certificate Store and Using Remote Desktop with Azure.


Ensure that the co-administrators for your Azure subscription contain the appropriate people. For more information, see How to Add and Remove Co-Administrators for your Azure Subscription.

Upgrade planning

You should familiarize yourself with the information in the Post-Deployment section of this article before deployment, as part of designing your Azure based solution is creating an upgrade plan.

There are three primary methods of deploying an application to Azure. The deployment methods, and the tools used to perform each type of deployment are described in the following table:


Deployment Method Tool Requirements

Web based

Azure Management Portal

Browser support for HTML5

Integrated Development Environment (IDE)

Visual Studio 2012 or later and the Azure SDK

Visual Studio 2012 or later

Command Line

The Azure SDK.

Command line tools for deployment are provided as part of the Azure SDK

Powershell based

The Azure Powershell

Check Prerequisites section from

For more information on packaging and deploying an application to Azure, see the following links:

If you perform a change to an existing deployment, such as upgrading the application or updating a certificate, this will cause the application instances to restart. A service configuration change does not restart the instances. The role instances handle the RoleEnvironment_Changing and RoleEnvironment_Changed events. Also, while most changes to a deployment can be made as in place updates to the existing service, some changes may require you to delete and then redeploy the hosted service.

For more information on updating an existing deployment, see Overview of Updating an Azure Service.

For more information on the actions that will cause a restart of the hosted service and how to minimize the impact of these actions, see Improving Application Availability in Azure.

You are charged for deployments even if they are not running. To ensure that you are not charged for resources you are not actively using, ensure that you delete any inactive deployments.

If you are performing tests that involve creating additional instances of your application, verify that the number of instances is reduced to the normal number after tests have completed.

If you have configured your deployment to allow remote desktop connections, ensure that you enable this functionality in the Azure Management Portal only when needed. Also, If you save the RDP file used for the connection to your local system, you may be unable to use it to connect to Azure after updating the deployment. If this is the case, download a new RDP file from the Azure Management Portal.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft