When you create a web project for an Azure website, you can provision a virtual machine in Azure. You can then configure the virtual machine with additional software, or use the virtual machine for diagnostic or debugging purposes.
To create a virtual machine when you create a website, follow these steps:
In the New ASP.NET Project dialog box, select the type of web application you want, and in the Azure section of the dialog box (in the lower-right corner), make sure that the Host in the cloud check box is selected (this check box is labeled Create remote resources in some installations).
In the dropdown list box under Microsoft Azure, choose Virtual Machine, and then choose the OK button.
Sign in to Azure if you're prompted. The Create Virtual Machine dialog box appears.
In the DNS name box, enter a name for the virtual machine. The DNS name must be unique in Azure. If the name you entered isn't available, a red exclamation point appears.
In the Image list, choose the VM image you want to base the virtual machine on. You can choose any of the standard Azure VM images or your own image that you've uploaded to Azure.
Leave the Enable IIS and Web Deploy check box selected unless you plan to install a different web server. You won't be able to publish from Visual Studio if you disable Web Deploy. You can add IIS and Web Deploy to any of the packaged Windows Server images, including your own custom images.
In the Size list, choose the size of the virtual machine.
Specify the login credentials for this virtual machine. Make a note of them, because you'll need them to access the machine through Remote Desktop.
In the Location list, choose the region to host the virtual machine in.
Choose the OK button to start create the virtual machine. You can follow the progress of the operation in the **Output ** window.
When the virtual machine is provisioned, publish scripts are created in a PublishScripts node in your solution. The publish script runs and provisions a virtual machine in Azure. The Output window shows the status. The script performs the following actions to set up the virtual machine:
devtest, but only if there isn't already such a storage account in the specified region.
13. (Optional) You can connect to the new virtual machine. In Server Explorer, expand the Virtual Machines node, choose the node for the virtual machine you created, and on its shortcut menu, choose Connect with Remote Desktop.
If you want to customize the publish scripts you created, see more in-depth information here.