Service Fabric 环境变量Service Fabric environment variables

Service Fabric 为每个服务实例提供了内置环境变量集。Service Fabric has built-in environment variables set for each service instance. 下面是环境变量的完整列表:The full list of environment variables is below:

环境变量Environment Variable 说明Description 示例Example
Fabric_ApplicationNameFabric_ApplicationName 应用程序的 fabric uri 名称The fabric uri name of the application fabric:/MyApplicationfabric:/MyApplication
Fabric_CodePackageNameFabric_CodePackageName 进程所属的代码包的名称The name of the code package to which the process belongs 代码Code
Fabric_Endpoint_IPOrFQDN_ServiceEndpointNameFabric_Endpoint_IPOrFQDN_ServiceEndpointName 终结点的 IP 地址或 FQDNThe ip address or FQDN of the endpoint 10.0.0.110.0.0.1
Fabric_Endpoint_ServiceEndpointNameFabric_Endpoint_ServiceEndpointName 终结点的端口号Port number for the endpoint 82348234
Fabric_Folder_App_LogFabric_Folder_App_Log 日志文件夹Log folder C:\\Data\\_App\\_Node_0\\MyApplicationType_App12\\logC:\\Data\\_App\\_Node_0\\MyApplicationType_App12\\log
Fabric_Folder_App_TempFabric_Folder_App_Temp 临时文件夹Temp folder C:\\Data\\_App\\_Node_0\\MyApplicationType_App12\\tempC:\\Data\\_App\\_Node_0\\MyApplicationType_App12\\temp
Fabric_Folder_App_WorkFabric_Folder_App_Work 工作文件夹Work folder C:\\Data\\_App\\_Node_0\\MyApplicationType_App12\\workC:\\Data\\_App\\_Node_0\\MyApplicationType_App12\\work
Fabric_Folder_ApplicationFabric_Folder_Application 应用程序主文件夹The applications home folder C:\\Data\\_App\\_Node_0\\MyApplicationType_App12C:\\Data\\_App\\_Node_0\\MyApplicationType_App12
Fabric_IsContainerHostFabric_IsContainerHost 一个布尔值,指定进程是否为一个容器A bool specifying whether the process is a container falsefalse
Fabric_NodeIdFabric_NodeId 运行进程的节点的节点 IDThe node ID of the node running the process bf865279ba277deb864a976fbf4c200ebf865279ba277deb864a976fbf4c200e
Fabric_NodeIPOrFQDNFabric_NodeIPOrFQDN 群集清单文件中指定的节点的 IP 或FQDN。The IP or FQDN of the node, as specified in the cluster manifest file. localhost 或 10.0.0.1localhost or 10.0.0.1
Fabric_NodeNameFabric_NodeName 运行进程的节点的节点名称The node name of the node running the process _Node_0_Node_0
Fabric_ServiceNameFabric_ServiceName 服务的结构 uri 名称(如果服务在 ExclusiveProcess 模式下托管)。The fabric uri name of the service, if service is hosted in ExclusiveProcess mode. 仅当使用 ServicePackageActivationMode ExclusiveProcess 创建服务时,此变量值才可用。This variable value is only available if you create the service with ServicePackageActivationMode ExclusiveProcess. fabric:/MyApplication/MyServicefabric:/MyApplication/MyService
Fabric_ServicePackageActivationIdFabric_ServicePackageActivationId ServicePackageActivationIdThe ServicePackageActivationId GUIDA GUID
Fabric_ServicePackageNameFabric_ServicePackageName 包含进程的服务包的名称Name of the service package the process is part of Web1PkgWeb1Pkg

Service Fabric 运行时使用的内部环境变量:Internal Environment Variables Used by Service Fabric Runtime:

  • Fabric_ApplicationHostIdFabric_ApplicationHostId
  • Fabric_ApplicationHostTypeFabric_ApplicationHostType
  • Fabric_ApplicationIdFabric_ApplicationId
  • Fabric_CodePackageInstanceIdFabric_CodePackageInstanceId
  • Fabric_CodePackageInstanceSeqNumFabric_CodePackageInstanceSeqNum
  • Fabric_RuntimeConnectionAddressFabric_RuntimeConnectionAddress
  • Fabric_ServicePackageActivationGuidFabric_ServicePackageActivationGuid
  • Fabric_ServicePackageInstanceIdFabric_ServicePackageInstanceId
  • Fabric_ServicePackageInstanceSeqNumFabric_ServicePackageInstanceSeqNum
  • Fabric_ServicePackageVersionInstanceFabric_ServicePackageVersionInstance
  • FabricActivatorAddressFabricActivatorAddress
  • FabricPackageFileNameFabricPackageFileName
  • HostedServiceNameHostedServiceName