在 Azure Service Fabric 中安装 .NET agent
您可以使用 Site24x7 APM Insight .NET agent 监控托管在 Azure Service Fabric 中的 .NET 应用程序。
Note
支持 3.1 及以上版本的 .NET 应用程序。
您可以按照以下步骤安装 agent:
-
使用 Visual Studio 中的 Package Manager Console,将 Nuget 包 Site24x7.APMInsight.Agent 添加到您的 Azure Service Fabric .NET 项目中。
PM> Install-Package Site24x7.APMInsight.Agent

-
在应用程序的 ServiceManifest.xml 文件中设置环境变量,如下所示:
<CodePackage>
... <EntryPoint>
<ExeHost>
...
<!-- It is mandatory for the WorkingFolder to be set as CodePackage. -->
<!-- This is because the environment variable to be persisted on the working folder to load the agent. -->
<WorkingFolder>CodePackage</WorkingFolder>
...
</ExeHost>
</EntryPoint>
...
<EnvironmentVariables>
...
<EnvironmentVariable Name="CORECLR_ENABLE_PROFILING" Value="1"/>
<EnvironmentVariable Name="CORECLR_PROFILER" Value="{9D363A5F-ED5F-4AAC-B456-75AFFA6AA0C8}"/>
<EnvironmentVariable Name="CORECLR_PROFILER_PATH_64" Value=".\site24x7\core\x64\ClrProfilerAgent.dll"/>
<EnvironmentVariable Name="CORECLR_PROFILER_PATH_32" Value=".\site24x7\core\x64\ClrProfilerAgent.dll"/>
<EnvironmentVariable Name="CORECLR_SITE24X7_HOME" Value=".\site24x7\core"/>
<EnvironmentVariable Name="DOTNET_ADDITIONAL_DEPS" Value=".\site24x7\core\additionalDeps"/>
<EnvironmentVariable Name="DOTNET_SHARED_STORE" Value=".\site24x7\core\store"/>
<EnvironmentVariable Name="S247_LICENSE_KEY" Value="xxxxxxxxxxxxxxxxxxxxxxxxx"/>
...
</EnvironmentVariables>
...
</CodePackage> -
将 S247_LICENSE_KEY 的值替换为从门户复制的 Site24x7 许可证密钥。

- 在 Azure Service Fabric 中发布应用程序。
- 执行事务以开始监控。
要查看数据,请登录您的 Site24x7 账户,选择 APM Insight,然后选择您的应用程序。
注意:
- 确保 agent 文件位于要发布到 Azure Service Fabric 的应用程序根目录中的 Site24x7 文件夹内。
- 确保环境变量设置正确。
