【问题标题】:What environment variables are available to the SetupEntryPoint process?SetupEntryPoint 进程可以使用哪些环境变量?
【发布时间】:2019-06-26 22:23:28
【问题描述】:

我希望编写一个脚本来作为 Service Fabric 服务的 SetupEntryPoint 执行。我想知道该过程可以使用哪些环境变量。

可用于运行服务的环境变量记录在 here 中。可以在 here 找到 SetupEntryPoint 的文档,但并未说明进程可以使用哪些环境变量。

【问题讨论】:

    标签: azure-service-fabric


    【解决方案1】:

    我编写了以下简单的批处理文件作为我的服务的 SetupEntryPoint 运行,它将进程可用的所有环境变量转储到临时文件:

    powershell.exe -NonInteractive -Command "& { Get-ChildItem 'env:*' | Sort-Object name | Format-Table -Wrap | Out-File 'C:/Windows/Temp/EnvVariables.txt' }"
    

    在我重新部署我的测试 Service Fabric 应用程序后,识别出以下与 Service Fabric 相关的变量(出于安全考虑,我省略了这些值):

    Fabric_ApplicationHostId  
    Fabric_ApplicationHostType
    Fabric_ApplicationId 
    Fabric_ApplicationName 
    Fabric_CodePackageInstanceSeqNum
    Fabric_CodePackageName
    Fabric_Endpoint_IPOrFQDN_RemotingEndpoint
    Fabric_Endpoint_RemotingEndpoint
    Fabric_Folder_App_Log          
    Fabric_Folder_App_Temp         
    Fabric_Folder_App_Work         
    Fabric_Folder_Application      
    Fabric_Folder_Application_OnHost                             
    Fabric_IsCodePackageActivatorHost
    Fabric_IsContainerHost         
    Fabric_NodeId                  
    Fabric_NodeIPOrFQDN            
    Fabric_NodeName                
    Fabric_PartitionId             
    Fabric_RuntimeConnectionAddress
    Fabric_RuntimeSslConnectionAddress
    Fabric_RuntimeSslConnectionCertEncodedBytes
    Fabric_RuntimeSslConnectionCertKey
    Fabric_RuntimeSslConnectionCertThumbprint
    Fabric_ServiceName
    Fabric_ServicePackageActivationGuid
    Fabric_ServicePackageActivationId
    Fabric_ServicePackageInstanceSeqNum
    Fabric_ServicePackageName
    Fabric_ServicePackageVersionInstance
    FabricActivatorAddress
    FabricPackageFileName
    HostedServiceName
    

    其中许多可以与文档here 交叉引用。如果这些都被正式记录在与 SetupEntryPoint 相关的某个地方,那就太好了。

    【讨论】:

      猜你喜欢
      • 2017-08-26
      • 2012-12-06
      • 1970-01-01
      • 2015-11-14
      • 2016-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多