Reputation: 57
For our service we are using Azure InstanceInputEndpoints to directly connect to an instance. We can find the external port number through:
RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["end-point-name"].PublicIPEndpoint.Port
What we need is a way to find the external DNS name or ip-address which can be used to connect to this instance through the load balancer, but how can we find it? We need the correct name for production and staging environment. We prefer to get the DNS name like
our-service.cloudapp.net
Upvotes: 1
Views: 498
Reputation: 10998
There is no way to get the DNS name from any sort of DNS lookup since Azure DNS does not supprt reverse lookups. And the service name is not saved in the service runtime.
The only way you can get the DNS name is to use the service management API from within your hosted service. There is an example at http://blogs.msdn.com/b/clouddeployments/archive/2010/05/12/making-calls-to-the-service-management-api-from-a-service-running-in-windows-azure.aspx, but it is a bit old. There are newer examples if you look around.
A couple suggestions:
Upvotes: 1