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?
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>