Install .NET Core Agent

Monitor your web applications built in .NET Core 2.0 and above with the help of the APM Insight .NET Core agent. You can track HTTP requests, SQL queries, errors, exceptions, web API calls, and remote calls in your ASP .NET Core applications hosted in IIS or Kestrel web servers.     

This method works only for Windows environment. Refer here to install APM Insight .NET Core agent in Linux environment.

Installation instructions:

  1. Log in to your Site24x7 account > APM > Add Application
  2. Download the .NET Core agent.
  3. Unzip the agent package  to a suitable location.
    Run a checksum validation to verify the integrity of the downloaded agent. Learn more.
  4. Run PowerShell in administrator mode.
  5. Navigate to the location of the unzipped agent and execute the command below. 
      • For local install
        ./InstallAgent.ps1  -Destination "<path>"   -InstallType "local"    -LicenseKey "<license_key>"
      • For global install
        ./InstallAgent.ps1   -Destination "<path>"   -InstallType "global"  -LicenseKey  "<license_key>"
  • Since global install will instrument all .NET Core applications unintentionally, Site24x7 recommends local install.
  • The destination path can be any folder at any drive in the machine. We recommend to not to use application's directory, since we may have to replace the application files periodically on every releases.

You have few options during installation as outlined in the table below.

Install option     Description      
 Destination Required. The absolute or relative path where agent will be installed.
Install type  Required. Determines whether the agent has to be installed locally or globally.
License key  Required. License key copied from Site24x7 Portal.
 Force Optional. Overwrites exisiting installation. We recommend backing up the existing configuration files first.
 Help Optional. Shows the guide to installing the agent.

6. Configure the application filters, if the .NET Core application is hosted on IIS server.

7. Start or restart the .NET Core application. (Note: If you’re using an IIS server for reverse proxy via AspNetCoreModule, you’ll need to reset the IIS server.)

8. Perform some transactions to start monitoring.

Note:

  • If the application is not hosted on IIS server, follow the steps below to change the .NET Core application’s name:
      1. Navigate to the application's publish directory.
      2. Create or edit the apmapplication.conf file, then add or modify the application name using the key value below:
application.name=<Your customizable application name>
<Your customizable application name> can be any meaningful name and your monitor will be created with the same name.
      1. Restart the application
  • To use a proxy server for agent communication:
      1. Navigate to the agent home directory > Dot Net Agent.
      2. Edit the apminsight.conf file and add the key values below:

behind.proxy = true

proxy.server.host = <proxyserver>

proxy.server.port = <proxyport>

proxy.auth.username = <proxyuser>

proxy.auth.password = <proxypassword>

      1. Restart the .NET Core applications.
  • Configure .NET Core agent via appsettings.json file

In general, when you download the Site24x7 APM Insight agent, the license key needs to be set separately in apminsight.conf. However, you can also set the license key in the app settings file instead of the conf file. Follow the instructions given below to do so.

        1. Open the appsettings.json file found under the current working directory of the application.
        2. Input the license key and application name as given below.
          {
          "site24x7": {
          "license.key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "application.name": "Your_Application_Name"
          }
          }
        3. The agent will look for the license key in the appsettings.json file. If it is not available, it will look for the license key in the environment variable.
Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.