Publish Windows Azure Application Wizard
After you develop a web application in Visual Studio, you can publish that application more easily to Windows Azure by using the Publish Windows Azure Application wizard. The following section explains the steps that you must complete before you use the wizard, and the remaining sections explain the features of the wizard.
You must perform the following tasks before you can use the Publish Windows Azure Application wizard:
Obtain a Microsoft account and a Windows Azure subscription.
Enable your web application for Windows Azure.
If you have already completed these tasks, you can skip the following two paragraphs.
After you obtain a Microsoft account and a Windows Azure subscription, you must log on to the Windows Azure Management Portal, and create a cloud service and a storage account. For more information about how to set up your Windows Azure environment, see Setting Up Services Required to Publish a Cloud Service from Visual Studio.
To enable your web application for Windows Azure, you must create a Windows Azure project with a web role in Visual Studio, and that project must be associated with the project for your application. To create the associated Azure project, open the shortcut menu for the project for your application, and then choose Add Windows Azure Deployment Project. Open the same shortcut menu again, and then choose Publish to Windows Azure. For more information about how to enable applications for Windows Azure, see How to: Migrate and Publish a Web Application to Windows Azure from Visual Studio.
You must invoke Visual Studio with administrator credentials (Run As Administrator).
When you are ready to publish your application, open the shortcut menu for the Windows Azure project, and then choose Publish. The following illustration shows the Publish Windows Azure Application wizard.
To choose a subscription
Before you use the wizard for the first time, you must download your credentials. Choose the Sign In To Download Credentials link. Sign in to the Windows Azure portal when prompted, provide your Windows Azure user name and password, and then save the settings to a file. You will import the settings file in the next step.
The settings file contains certificate information. Save the file to a secure location.
Choose Import to populate the subscription list.
The settings file is in the same format that WebMatrix uses and has a .publishsettings extension.
In the Choose your subscription list, choose the subscription to use for this deployment. If you choose <Manage…>, you can create, edit, or delete subscriptions.
The settings file can contain more than one subscription.
At this point, you can publish the application, or you can modify any setting for this deployment. If you are ready to publish, choose Publish to deploy this application. Otherwise, choose Next to continue.
If you chose Publish in this step, you can monitor the status of this deployment in Visual Studio.
You can modify both common and advanced settings for a deployment by using the Publish Windows Azure Application wizard. For example, you can choose a setting to deploy your application to a test environment before you release it. The following illustration shows the Common Settings tab for a Windows Azure deployment.
To configure the settings
In the Cloud service list, perform one of the following sets of steps:
Choose an existing service. The data center location for this cloud service appears. You should note this location and make sure that your storage account location is in the same data center.
Choose Create New to create a cloud service that Windows Azure hosts. In the Create Windows Azure Services dialog box, specify a name for the service, and then specify a data center that’s near you or most of your clients.
In the Environment list, choose either Production or Staging. Choose the staging environment if you want to deploy your application to a test environment. You can move your application to the production environment later.
In the Build configuration list, choose either Debug or Release.
In the Service configuration list, choose either Cloud or Local.
Select the Enable Remote Desktop for all roles check box to enable Remote Desktop. This option is primarily used for troubleshooting. When you select this check box, the Remote Desktop Configuration dialog box appears. Choose the Settings link to change the configuration.
Select the Enable Web Deploy for all web roles check box to enable web deployment. You must enable Remote Desktop to use this feature. For more information, see Publishing a Cloud Service using the Windows Azure Tools. For more information about Web Deploy, see Publishing a Cloud Service using the Windows Azure Tools.
Choose the Advanced Settings tab. In the Deployment label field, either accept the default name, or enter a name of your choosing. To append the date to the deployment label, leave the check box selected.
In the Storage account list, choose the storage account to use for this deployment. Compare the locations of the data centers for your cloud service and your storage account. Ideally, these locations should be the same.
The Windows Azure storage account stores the package for the application deployment. After the application is deployed, the package is removed from the storage account.
Select the Deployment update check box if you want to deploy only updated components. This type of deployment can be faster than a full deployment. Choose the Settings link to open the Deployment update settings dialog box, shown in the following illustration.
You can choose either of two options for update deployment, incremental or simultaneous. An incremental deployment updates one deployed instance at a time, so that your application remains online and available to users. A simultaneous deployment updates all deployed instances at once. Simultaneous update is faster than incremental update, but if you choose this option, your application might not be available during the update process.
You should select the check box for If deployment can't be updated, do a full deployment if you want the full deployment to take place automatically if an update deployment fails. A full deployment resets the virtual IP (VIP) address for the cloud service. For more information, see How to: Retain a Constant Virtual IP Address for a Cloud Service.
To debug your service, select the Enable IntelliTrace check box.
To profile this application, select the Enable profiling check box, and then choose the Settings link to display the profiling options.
You must use Visual Studio Ultimate to enable either IntelliTrace or Tier Interaction Profiling (TIP), and you can't enable both at the same time.
For more information, see Debugging a Published Cloud Service with IntelliTrace and Visual Studio and Testing the Performance of a Cloud Service.
Choose Next to view the summary page for the application.
To publish the project
You can create a publishing profile from the settings that you have chosen. For example, you might have one profile for a test environment and another for production. To save this profile, choose the Save icon. The wizard creates the profile and saves it in the Visual Studio project. To modify the profile name, open the Target profile list, and then choose <Manage…>.
The publishing profile appears in Solution Explorer in Visual Studio, and the profile settings are written to a file with an .azurePubxml extension. Settings are saved as attributes of XML tags.
Choose Publish to publish your application. You can monitor the process status in the Output pane in Visual Studio.