如何获取工作角色中的Web角色输入端点? [英] How to get web role input endpoint in worker role?

查看:50
本文介绍了如何获取工作角色中的Web角色输入端点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个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.

有什么办法吗?

推荐答案

您应该查看 Microsoft.WindowsAzure.ServiceRuntime 命名空间中的> 类.使用这些,您应该能够找到所有角色实例的IP地址和端口.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆