I have deployed cloud service (NOT virtual machine) and attached it to the virtual network that I've created with following cloud service configuration:
<NetworkConfiguration>
<VirtualNetworkSite name="MyVirtualNetwork" />
<AddressAssignments>
<InstanceAddress roleName="SampleAzureVpn">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
When I enter the virtual network dashboard in Azure Management panel I can see that my instance has it's IP set to 192.168.176.133.
Now, the question is, is this the static IP, or can it change for given instance? I need to ensure that this IP doesn't change on instance reset etc.
I had the same problem with multiple instances.
As far as I know the ips are dynamic. That's for a good reason. When dynamically adding instances for different roles, prediction of the ips would be a configuration nightmare.
I solved it via an internal load balancer. Using an internal load balancer allows you to define one static ip address that takes into account that multiple web/ worker roles can be addressed from within the VPN. Have a look here internal load balancer overview
--- update ---
To clarify: Internal load balancers on web and worker roles do work, have a look onto the pieces you have to add to make it running. Unlike the ILB for virtual machines, you don't need Powershell, just configuration.
put in the loadbalancer definition to your ServiceConfiguration.Cloud.cscfg:
Add your inputendpoint to the web/ workerrole in question in ServiceDefinition.csdef:
You have to have the subset already configured as part of the ServiceDefinition.csdef. The static ip should be part of the subnet.
Please refer to this for some more information. I also had some trouble setting it up. Documentation is not that complete.