Deploying a Cloud Service to a VNet

In a recent post about Microsoft Azure Virtual Networks, I made the recommendation that Cloud Services should be deployed to Microsoft Azure Virtual Networks. The driving factor behind this recommendation comes from my personal real-world experience, where I learned the hard way, that moving a deployed Cloud Service to a Virtual Network meant downtime…

Getting it Done

In order to deploy a Cloud Service to a Virtual Network, we must add Network Configuration section to the Service Configuration file. The following is the updated ServiceConfiguration.Cloud.cscfg that specified that my Cloud Service is to be deployed to my Virtual Network called AzureVNet and more specifically to its Subnet called MiddleTier.

<?xml version="1.0" encoding="utf-16"?>
<ServiceConfiguration xmlns:xsd="" xmlns:xsi="" serviceName="briseboisDemo3" osFamily="4" osVersion="*" xmlns="">

  <Role name="Compute">
    <Instances count="5" />

    <!-- Name of the target Virtual Network -->
    <VirtualNetworkSite name="AzureVNet" />

    <!-- Associating a Role to a Specific Subnet by name -->
      <InstanceAddress roleName="Compute">
          <Subnet name="MiddleTier" />

Looking at these configuration updates, you may be asking whether we have to do anything else to successfully deploy to a Virtual Network. The answer is no, there is nothing more to it. Fire up PowerShell or your favorite tool to deploy your updated Cloud Service package to Azure.

I used the following Network Configuration to create my test Virtual Network.

<?xml version="1.0" encoding="utf-8"?>
<NetworkConfiguration xmlns:xsd="" xmlns:xsi="" xmlns="">
    <Dns />
      <VirtualNetworkSite name="AzureVNet" Location="East US 2">
          <Subnet name="MiddleTier">

One response to Deploying a Cloud Services to A Virtual Network (VNet) on #Azure


    Thanks Q


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s