Azure Web / Worker Role in virtual networks

I want to reach from my Azure Webrole an on-premise webservice. But I don’t want to make my on-premise Webservice public available. Site to Site connection sounds to be the solution. (see MSDN http://msdn.microsoft.com/en-us/library/windowsazure/jj156206.aspx). But is it possible to to add Azure Web and Workroles to a virtual network created?

YES!

The configuration of a virtual network for Web and Workerroles (PaaS) is diffrent to the configuration of a virtual network for a VM (IaaS). While managementportal gives the opportunity to configure a virtual network for a VM there is no such choice when creating a CloudService. In fact that makes sense as a CloudService can host multiple Web and Workerroles. The network configuration for Web and Workerroles is done in the cloud service configuration (*.cscfg) file. There is currently no wizard provided to add the configuration. Add the following configuration to your CloudService config to add your Web and Workerroles to an existing virtual network.

<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration>
  <!-- configuration of your roles -->
  <NetworkConfiguration>
    <VirtualNetworkSite name="[network name]" />
    <AddressAssignments>
      <InstanceAddress roleName="[role name]">
        <Subnets>
          <Subnet name="[name of subnet]" />
        </Subnets>
      </InstanceAddress>
      <InstanceAddress roleName="[role name]">
        <Subnets>
          <Subnet name="[name of subnet]" />
        </Subnets>
      </InstanceAddress>
    </AddressAssignments>
  </NetworkConfiguration>
</ServiceConfiguration>
Advertisements

3 thoughts on “Azure Web / Worker Role in virtual networks

  1. Can you confirm you were able to get a worker role connected using this method? My web roles have no issues, but worker role on the other hand hasn’t shown up in the virtual network config.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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