问题
I have a Cloud Service
that has Worker Role. Cloud Service is set to scale at 5 instances. There is an operation that requires communication from Azure to our data center. For the communication to happen, we have to Whitelist the IP address.
My question is that since I have set the Cloud Service
to have 5 instances, do I need 5 static IPs or 1?
Also how does this pan out if I set it to Auto Scale?
回答1:
All five (or any number of) instances in a single Cloud Service sit behind a single IP address.
The assigned IP address for the cloud service doesn't change unless you deprovision and reprovision the service (xyz.cloudapp.net
). So, if you resolved your cloudapp.net
name to an IP address, you'd be able to whitelist that IP address (until such time that you take down the Cloud Service. Then the IP address is lost).
If you want to ensure that you always know the IP address, even if you deprovision / reprovision, you can set up a reserved IP address in Azure, and then assign it to the Cloud Service.
More info on reserved IP addresses here.
来源:https://stackoverflow.com/questions/33713063/static-ip-for-cloud-service-on-azure