Azure Compute Emulator: Is it possible to control the IP of individual instances?

前端 未结 2 1995
轻奢々
轻奢々 2021-01-12 16:36

Working with the June 2012 Azure SDK, Visual Studio 2010, and IIS Express, I have a web application which has been running on 127.255.0.2. I\'m using ACS for authentication,

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-12 16:55

    Why would you want to change that IP Address? This is used only internally to avoid IP/Port conflicts. All your roles are only accessed via 127.0.0.1:[port] and this is the address you should use as base address of your relying party app. The 127.255.0.XX addresses are internal addresses that live behind the emulated Load Balancer of the Compute Emulator.

    There is no formal, nor informal way to control the instance's IP Address of instance / role for Compute Emulator. Plus even if there was a way to do that, I would not suggest to use it!

    You can always get the correct IP Address and Port of any Endpoint configured in your cloud service via the RoleEnvironment.CurrentRoleInstance.InstanceEndpoints property.

    Read about IP Address and Port allocation here.

    UPDATE

    Although your app is bound to 127.255.0.XX (emulated Direct IP Address, a.k.a. DIP) in the IIS Express, the actual call to your app shall go through 127.0.0.1:81 (emulated Virtual IP Address, a.k.a. VIP) (where only port changes). And this is default load page when Visual Studio launches your app. The development Fabric (a.k.a. Compute Emulator) has emulated Load Balancer, which listens on 127.0.0.1:81 (emulated VIP) and redirects traffinc to the appropriate instances, which are spread across 127.255.0.XX (emulated DIP). That's why you have to always use 127.0.0.1 when working with compute emulator and when Configuring ACS relying party. Anything else you do is wrong and not representing Azure environment.

    You can read through this and that blog entries to understand the reminology and networking withing Windows Azure.

提交回复
热议问题