There are occasions where a customer will push a .NET Core application to a windows host without using nuget, or any of the microservice push capabilities out of VisualStudio. I find this most commonly where the development team is pushing their apps to a repository but the devops team then needs to load the agent during actual deployment.
The steps below outline how to instrument an already deployed application. These steps can be followed and implemented for devops operations.
NOTE: This will take up a full non-microservice APM license.
STEP 1: Download the .NET Core agent for Windows
Open a web browser
Navigate to: https://www.nuget.org/packages?q=appdynamics
Search for “AppDynamics”
Determine which package to download here: https://docs.appdynamics.com/display/PRO45/.NET+Microservices+Agent
If the host is a single Windows VM not running in Azure or is a single Windows host, agnostic to the cloud environment (i.e. customer administers the OS), then download “AppDynamics.Agent.Distrib.Micro.Windows"
STEP 2: Install the AppDynamics Agent DLLs
Create a directory (preferably at root C: level) for where the AppDynamics Agent DLL files will reside. Example: C:\AppDynamics\dotNETcoreAgent\
Permit read, write and execute to the users of the .NET Core application
IIS: If the application is an ASP.NET Core application running in IIS , then make sure that “IIS_IUSRS” has full access.
Extract the downloaded "AppDynamics.Agent.Distrib.Micro.Windows" nuget package into a temporary directory.
Navigate into the "tools" subdirectory of the extracted nuget package.
Copy the following files into the newly created directory from STEP 2.1
AppDynamics.Agent.dll AppDynamics.Profiler_x64.dll AppDynamicsAgentLog.config AppDynamics.Agent.netstandard.dll AppDynamics.Profiler_x86.dll
STEP 3: Setup Environment Variables for the .NET Core CLR Profiler
Environment variables are described in detail here: https://docs.appdynamics.com/display/PRO45/Install+the+.NET+Core+Microservices+Agent+for+Windows
Open Windows Explorer
Right click “This PC”
Click “Advanced System Settings”
Click “Advanced” Tab
Click “Environment Variables…”
Click “New…” under “System variables” and add each of the following.
NOTE: <appd_agent_path> is the path created in STEP 2.1 above
CORECLR_PROFILER_PATH_32= <appd_agent_path> \AppDynamics.Profiler_x86.dll
CORECLR_PROFILER_PATH_64= <appd_agent_path> \AppDynamics.Profiler_x64.dll
Click “OK” out of each dialog and close all windows.
STEP 4: Configure the AppDynamics Agent
Copy the “AppDynamicsConfig.json” file to the Application’s directory (where the .NET Core DLL files reside).
Rename “AppDynamicsConfig.json” to “<APP>.AppDynamicsConfig.json”
If unsure the name of the application ask the developers or those who deploy and start the application.
For IIS ASP.NET Core applications, the name of the applications can be found in “web.config” within the application’s directory.
Edit the “<APP>.AppDynamicsConfig.json” file and configure as described here: https://docs.appdynamics.com/display/PRO45/AppDynamicsConfig.json+File
At minimum, need “Controller” and “Application” fields sets (reference docs).
When there are multiple .NET Core "Service/app" deployed on 1 host
The "tier" and "node" should be different for each "service/app" even though they reside on the same host.
The application "name" will be the same for all "services/apps" that should be grouped together to logically complete/represent an application.
Save and close the file.
STEP 5: Restart the application
If application is an IIS ASP.NET Core application, then a full IIS restart is required. This can be done by opening a command prompt and executing: iisreset
... View more