在 Service Fabric 的来宾可执行文件中使用动态分配的端口

Posted

技术标签:

【中文标题】在 Service Fabric 的来宾可执行文件中使用动态分配的端口【英文标题】:Using dynamically assigned port in guest executable in Service Fabric 【发布时间】:2018-03-22 02:09:04 【问题描述】:

如何从来宾可执行文件 Rest Server 中获取 Service Fabric 分配的端口?

我需要配置我的可执行文件以使用此端口。我想我可以使用端口号作为参数来执行我的应用程序,但我没有找到它。

解决方法是 https://medium.com/@mattmazzola/service-fabric-using-dynamically-assigned-port-in-guest-executable-91a881e2a27a 官方不支持,下个版本就不能用了。

【问题讨论】:

【参考方案1】:

应在来宾可执行文件启动之前设置以下环境变量

Fabric_Endpoint_[YourServiceName]TypeEndpoint

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-manage-multiple-environment-app-configuration

【讨论】:

以上是关于在 Service Fabric 的来宾可执行文件中使用动态分配的端口的主要内容,如果未能解决你的问题,请参考以下文章

管理来宾可执行文件依赖项 - 本地 Service Fabric

Service Fabric 命名服务未转发到分配给来宾可执行文件的端点

如何在 Service Fabric 中安装批处理文件

Service Fabric 健康检查

您如何监控 Fabric.exe 和其他 Service Fabric 可执行文件?

运行 Service Fabric 应用的 AppManifestCleanupUtil 可执行文件时生成失败