Deploy the Package using another IDE

  1. From your editor, open ServiceManifest.xml in each folder in the published application root.
  2. Add the following environment variables in each CodePackage:
    <CodePackage ...>
      <EntryPoint>
        ...
      </EntryPoint>
      <EnvironmentVariables>
        <EnvironmentVariable Name="COR_ENABLE_PROFILING" Value="1" />
        <EnvironmentVariable Name="COR_PROFILER" Value="{39AEABC1-56A5-405F-B8E7-C3668490DB4A}" />
        <EnvironmentVariable Name="COR_PROFILER_PATH" Value=AppDynamics/AppDynamics.Profiler_x64.dll" />
       </EnvironmentVariables>
    </CodePackage>
  3. Using PowerShell, unpack AppDynamics.Agent.dll, AppDynamics.Profiler_x64.dll, AppDynamicsAgentLog.config, AppDynamicsConfig.json from <nuget_package>\content\AppDynamics to the code package folder that contains the executable you want to run.
  4. Make a copy of the of the AppDynamicsConfig.json file and rename it to <executable_name>.AppDynamicsConfig.json.
    For example, <servicefabricapplicationname>.AppDynamicsConfig.json.
    Note: When you rename the .json file to the application name, do not include .exe at the end of your application name.
  5. Update <executable_name>.AppDynamicsConfig.json with your configuration information:
    Do not specify the node; it will be assigned automatically. Specifying the tier is optional; it could be assigned automatically.
    {
     "controller":
     {
       "host":"",
       "port":0,
       "account":"",
       "password":""
     },
     "application":
     {
     "name":""
     }
    }
    
    

The next steps are optional and should only be used if you need per service-instance control of the controller/application/tier.

  1. Add the following environment variables to each CodePackage:
    <EnvironmentVariable Name="appdynamics.controller.hostName" Value="" />
    <EnvironmentVariable Name="appdynamics.controller.port" Value="" />
    <EnvironmentVariable Name="appdynamics.agent.accountName" Value="" />
    <EnvironmentVariable Name="appdynamics.agent.accountAccessKey" Value="" />
    <EnvironmentVariable Name="appdynamics.agent.applicationName" Value="" />
    <EnvironmentVariable Name="appdynamics_agent_tier_name" Value="" />
  2. Modify ApplicationManifest.xml. In each ServiceManifestImport and CodePackage folder add:
    • In ServiceManifestImport:
      <EnvironmentOverrides CodePackageRef="Code">
        <EnvironmentVariable Name="appdynamics.controller.hostName" Value="<AppD_ControllerHostName>" />
        <EnvironmentVariable Name="appdynamics.controller.port" Value="<AppD_ControllerPort>" />
        <EnvironmentVariable Name="appdynamics.agent.accountName" Value="<AppD_AccountName>" />
        <EnvironmentVariable Name="appdynamics.agent.accountAccessKey" Value="<AppD_AccountAccessKey>" />
        <EnvironmentVariable Name="appdynamics.agent.applicationName" Value="<AppD_ApplicationName>" />
        <EnvironmentVariable Name="appdynamics_agent_tier_name" Value="<AppD_Service_Name_TierName>" />
      </EnvironmentOverrides>
    • In Parameters:
      <Parameter Name="AppD_ControllerHostName" DefaultValue="<Your_Controller>" />
      <Parameter Name="AppD_ControllerPort" DefaultValue="<Your_ControllerPORT>" />
      <Parameter Name="AppD_AccountName" DefaultValue="<Your_Controller_AccountName>" />
      <Parameter Name="AppD_AccountAccessKey" DefaultValue="<Your_Controller_AccessKey>" />
      <Parameter Name="AppD_ApplicationName" DefaultValue="<Your_Controller_App_Name>" />
    • For each service: <Parameter Name="<AppD_Service_Name_TierName>" DefaultValue="<Tier_Name_For_Service>" />
  3. If you need to provide the Splunk AppDynamics configuration during application package deployment, you can now do it using the -ApplicationParameter switch of the New-ServiceFabricApplication cmdlet.