如何获取工作角色中的Web角色输入端点? [英] How to get web role input endpoint in worker role?
问题描述
我们有一个Azure应用程序,它具有工作角色和Web角色,工作角色必须知道暴露给外部的Web角色地址.这是因为,Web角色包含一些辅助角色可以使用的Web API,因此我们需要确切地知道Web角色的url地址.
We have an Azure application, which has a worker role and a web role, and the worker role has to know the web role address exposed to outside. That's because, web role include some Web API that worker role can use, so we need to know the exactly url address of web role.
有什么办法吗?
推荐答案
您应该查看 RoleInstance
, Microsoft.WindowsAzure.ServiceRuntime
You should look into Role
, RoleInstance
, RoleInstanceEndpoint
classes in Microsoft.WindowsAzure.ServiceRuntime
Namespace. Using these you should be able to find the IP address and Port of all the role instances.
这篇关于如何获取工作角色中的Web角色输入端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!