Help Docs

Install the .NET agent in Azure App Services (Linux)

Monitor your .NET applications hosted on Azure App Service running on Linux by integrating the Site24x7 APM Insight .NET agent.

You can install the agent using either of the following methods:

  1. Using a custom deployment script
  2. Using NuGet package and App Settings

Using a custom deployment script

Install the .NET agent using a custom startup script that automates setup and configuration during application startup.

Step 1: Create the deployment script

  1. Download the apm-dotnetagent-deploy.sh script.
  2. In the Azure portal, navigate to your App Service.
  3. Go to Development Tools > Advanced Tools and click Go to open the Kudu console.
  4. In the Kudu console, navigate to Tools > File Manager.
  5. Upload or drag and drop the apm-dotnetagent-deploy.sh file into the /home directory.
Note

If your application already uses a startup command, open the apm-dotnetagent-deploy.sh script and append the existing startup command to the end of the file. This ensures that your application starts normally after the Site24x7 agent is initialized.

Step 2: Configure the license key

  1. Copy your License Key from the Site24x7 portal.
  2. In your Azure App Service, navigate to Settings > Environment variables.
  3. Add the following environment variable:
    S247_LICENSE_KEY=YOUR_LICENSE_KEY
  4. Click Save to apply the changes.

Step 3: Configure the startup command

  1. In your Azure App Service, navigate to Settings > Configuration.
  2. Open the Stack Settings tab.
  3. In the Startup command field, enter:
    /home/apm-dotnetagent-deploy.sh
  4. Click Save to apply the configuration.

Step 4: Restart the web app

After saving the startup command:

  1. In the Azure Portal, navigate to your web app.
  2. Click Restart to restart the application.
  3. Start performing transactions to add the APM monitor.
Next step

Go to the Site24x7 APM Insight dashboard and verify that your application appears and starts reporting performance metrics.

Using NuGet package and App Settings

Install the .NET agent by adding the NuGet package and configuring required environment variables in Azure App Service.

  1. Add the NuGet package Site24x7.APMInsight.Agent to your .NET project using your preferred method (e.g., Visual Studio NuGet Manager or CLI).
  2. Build and publish the application to your Azure App Service (Linux).
  3. In the Azure portal, navigate to your App Service.
  4. Go to Settings > Configuration > App settings.
  5. Click + Add and add the following environment variables:
    CORECLR_ENABLE_PROFILING=1
    CORECLR_PROFILER={9D363A5F-ED5F-4AAC-B456-75AFFA6AA0C8}
    CORECLR_PROFILER_PATH_32=/home/site/wwwroot/site24x7/x86/libClrProfilerAgent.so
    CORECLR_PROFILER_PATH_64=/home/site/wwwroot/site24x7/x64/libClrProfilerAgent.so
    DOTNET_STARTUP_HOOKS=/home/site/wwwroot/site24x7/netstandard2.0/DotNetAgent.Loader.dll
    DOTNETCOREAGENT_HOME="/home/site/wwwroot/site24x7"
    MANAGEENGINE_COMMUNICATION_MODE=direct
    S247_LICENSE_KEY=YOUR_LICENSE_KEY_HERE
    SITE24X7_APP_NAME=<monitor name>
    Note

    Replace YOUR_LICENSE_KEY_HERE with your actual license key copied from the Site24x7 portal.

  1. Click Save to apply the changes.
  2. Restart the App Service to apply the newly configured environment variables.
  3. Once the app is restarted, perform a few transactions to generate traffic.
Note

Ensure that all environment variables are set exactly as listed. Incorrect paths or missing variables can prevent the agent from functioning properly.

Related article

Install the .NET agent on Azure App Services Windows

Was this document helpful?

Would you like to help us improve our documents? Tell us what you think we could do better.


We're sorry to hear that you're not satisfied with the document. We'd love to learn what we could do to improve the experience.


Thanks for taking the time to share your feedback. We'll use your feedback to improve our online help resources.

Shortlink has been copied!