Help APM APM for .NET Add .NET agent in Kubernetes

Install the APM Insight .NET agent in a Kubernetes environment

Installing the .NET and .NET Core agents in a Kubernetes environment is similar to installing the standard .NET agent in Windows, except that you must configure the DockerFile to perform the installation.

Table of contents


Install the .NET agent in a Kubernetes Windows container

The following is an example of how to configure the .NET agent in a Kubernetes Windows container. You need to modify the DockerFile for the application to install and configure the agent.

FROM mcr.microsoft.com/dotnet/framework/aspnet

# Publish your application
COPY your app to be published /inetpub/wwwroot

# Download the APM Insight .NET agent installer
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\
Invoke-WebRequest "https://staticdownloads.site24x7.com/apminsight/agents/apminsight-dotnetagent.msi" -UseBasicParsing -OutFile "apminsight-dotnetagent.msi"

# Install the APM Insight .NET agent
RUN Start-Process -Wait -FilePath msiexec -ArgumentList /i, "apminsight-dotnetagent.msi", /qn, editconfig=false, useappfilters=false, license.key=YOUR_LICENSE_KEY

# Remove the APM Insight .NET agent installer
RUN Remove-Item "apminsight-dotnetagent.msi"

# Set your application name
ENV SITE24X7_APP_NAME=YOUR_APP_NAME

 

Install the .NET Core agent in a Kubernetes Windows container

The following is an example of how to configure the .NET Core agent in a Kubernetes Windows container. You need to modify the DockerFile for the application to install and configure the agent.

FROM mcr.microsoft.com/windows/servercore:ltsc2019

# Publish your application
COPY your app to be published /app

# Download the APM Insight .NET core agent zip
RUN powershell.exe [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\
Invoke-WebRequest "https://staticdownloads.site24x7.com/apminsight/agents/apminsight-dotnetcoreagent.zip" -UseBasicParsing -OutFile "apminsight-dotnetcoreagent.zip"

# Extract APM Insight .NET core agent zip
RUN powershell.exe Expand-Archive -LiteralPath 'apminsight-dotnetcoreagent.zip' -DestinationPath apminsight-dotnetcoreagent

# Install the APM Insight .NET core agent
RUN powershell.exe ".\apminsight-dotnetcoreagent\dotnet_core\InstallAgent.ps1" -Destination ".\site24x7" -InstallType global -LicenseKey YOUR_LICENSE_KEY

# Remove the APM Insight .NET agent installer zip
RUN powershell.exe Remove-Item "apminsight-dotnetcoreagent.zip"

# Remove the APM Insight .NET agent installer
RUN powershell.exe Remove-Item "apminsight-dotnetcoreagent" -Recurse -Force

# Set your application name
ENV SITE24X7_APP_NAME=YOUR_APP_NAME

# Windows or Servercore images may not include .NET Core SDK or runtime
RUN dotnet sdk/runtime installerWORKDIR /appENTRYPOINT ["dotnet", ".\\YOUR_APP_NAME.dll"]

 

Install the .NET Core agent in a Kubernetes Linux container

Get information on configuring the .NET Core agent in a Linux Kubernetes container.


Related articles

How to install various APM Insight agents in a Docker container
Java | .NET | PHP | Node.js | Python

How to install various APM Insight agents in a Kubernetes environment
Java | PHP | Node.js | Python

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help APM APM for .NET Add .NET agent in Kubernetes