Connect Windows virtual machines created with the classic deployment model with a virtual network or cloud service

Important

Azure has two different deployment models for creating and working with resources: Resource Manager and Classic. This article covers using the Classic deployment model. Microsoft recommends that most new deployments use the Resource Manager model.

Windows virtual machines created with the classic deployment model are always placed in a cloud service. The cloud service acts as a container and provides a unique public DNS name, a public IP address, and a set of endpoints to access the virtual machine over the Internet. The cloud service can be in a virtual network, but that's not a requirement. You can also connect Linux virtual machines with a virtual network or cloud service.

If a cloud service isn't in a virtual network, it's called a standalone cloud service. The virtual machines in a standalone cloud service communicate with other virtual machines by using the other virtual machines’ public DNS names, and the traffic travels over the Internet. If a cloud service is in a virtual network, the virtual machines in that cloud service can communicate with all other virtual machines in the virtual network without sending any traffic over the Internet.

If you place your virtual machines in the same standalone cloud service, you can still use load balancing and availability sets. For details, see Load balancing virtual machines and Manage the availability of virtual machines. However, you can't organize the virtual machines on subnets or connect a standalone cloud service to your on-premises network. Here's an example:

Virtual machines in a standalone cloud service

If you place your virtual machines in a virtual network, you can decide how many cloud services you want to use for load balancing and availability sets. Additionally, you can organize the virtual machines on subnets in the same way as your on-premises network and connect the virtual network to your on-premises network. Here's an example:

Virtual machines in a virtual network

Virtual networks are the recommended way to connect virtual machines in Azure. The best practice is to configure each tier of your application in a separate cloud service. However, you may need to combine some virtual machines from different application tiers into the same cloud service to remain within the maximum of 200 cloud services per subscription. To review this and other limits, see Azure Subscription and Service Limits, Quotas, and Constraints.

Connect VMs in a virtual network

To connect virtual machines in a virtual network:

  1. Create the virtual network in the Azure portal and specify 'classic deployment'.
  2. Create the set of cloud services for your deployment to reflect your design for availability sets and load balancing. In the Azure portal, click New > Compute > Cloud service for each cloud service.

    As you fill out the cloud service details, choose the same resource group used with the virtual network.

  3. To create each new virtual machine, click New > Compute, then select the appropriate VM image from the Featured apps.

    In the VM Basics blade, choose the same resource group used with the virtual network.

    VM Basics blade when using a VNet

  4. As you fill out the VM Settings, choose the correct Cloud service or virtual network for the VM.

    Azure will select the other item based on your selection.

    VM Settings blade when using a VNet

Connect VMs in a standalone cloud service

To connect virtual machines in a standalone cloud service:

  1. Create the cloud service in the Azure portal. Click New > Compute > Cloud service. Or, you can create the cloud service for your deployment when you create your first virtual machine.
  2. When you create the virtual machines, choose the same resource group used with the cloud service.

    Add a virtual machine to an existing cloud service

  3. As you fill out the VM details, choose the name of cloud service created in the first step.

    Selecting a cloud service for a virtual machine

Next steps

After you create a virtual machine, it's a good idea to add a data disk so your services and workloads have a location to store data.