Schedule demo

Install APM Insight .NET Agent in Docker Container


Installing the .NET agent in a Docker container is the same as installing the standard .NET agent in Windows. You need to configure the DockerFile to perform the installation.

Note:
  • Replace [YOUR_LICENSE_KEY] with your actual APM Insight license key from Applications Manager.
  • Replace [YOUR_APP_NAME] with your application name.

Install .NET agent on a Windows Docker container

Below is an example of configuring the .NET agent on a Windows Docker container.

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

EXPOSE 80
# 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://www.manageengine.com/products/applications_manager/54974026/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], apm.host=
[APM_HOST], apm.port=[APM_PORT]

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

# Set your application name
ENV APMINSIGHT_APP_NAME=[YOUR_APP_NAME]

Install .NET agent on a Linux Docker container

Below is an example of configuring the .NET agent on a Linux Docker container.

# Use Linux-based ASP.NET runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0

# Set working directory
WORKDIR /app

# Copy your published app
COPY [YOUR_APP_TO_BE_PUBLISHED_FOLDER]/ . # replace with your actual published app folder path

# Use wget to download and install APM Insight Data Exporter & agent
RUN apt-get update && \
apt-get install -y wget ca-certificates unzip && \
RUN wget -O InstallDataExporter.zip https://www.manageengine.com/products/applications_manager/54974026/InstallDataExporter.zip && unzip InstallDataExporter.zip && \
RUN sh InstallDataExporter.sh -root -nsvc -lk "[YOUR_LICENSE_KEY]" -apm.host "https://[APM_HOST]:[APM_PORT]" && \
wget -O InstallNetCoreAgent.zip https://www.manageengine.com/products/applications_manager/54974026/InstallNetCoreAgent.zip && unzip InstallNetCoreAgent.zip && \
sudo -E ./InstallNetCoreAgent.sh -Destination "/opt/apminsight/dotnet" -LicenseKey "[YOUR_LICENSE_KEY]"

# set the env variables for the APM Insight Agent
ENV APMINSIGHT_LICENSEKEY="[YOUR_LICENSE_KEY]"
ENV APMINSIGHT_APP_NAME="[YOUR_APP_NAME]"
ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER="{9D363A5F-ED5F-4AAC-B456-75AFFA6AA0C8}"
ENV DOTNETCOREAGENT_HOME="/opt/manageengine/ManageEngineDotNetCoreAgent"
ENV CORECLR_PROFILER_PATH_64="/opt/manageengine/ManageEngineDotNetCoreAgent/x64/libClrProfilerAgent.so"
ENV CORECLR_PROFILER_PATH_32="/opt/manageengine/ManageEngineDotNetCoreAgent/x86/libClrProfilerAgent.so"
ENV DOTNET_STARTUP_HOOKS="/opt/manageengine/ManageEngineDotNetCoreAgent/netstandard2.0/DotNetAgent.Loader.dll"
ENV MANAGEENGINE_COMMUNICATION_MODE="ExporterService"


# Expose the required for your app port (adjust if needed)
EXPOSE 80

# Set entrypoint
ENTRYPOINT ["dotnet", "YOUR_APPLICATION.dll"] # replace with your actual app DLL

Install the .NET Core agent on a Windows Docker container

Below is an example of configuring the .NET Core agent on a Windows Docker container.

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

# Publish your application
COPY [YOUR_APP_TO_BE_PUBLISHED]

#Install .NET core framework

RUN powershell.exe [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\ 
Invoke-WebRequest "https://download.visualstudio.microsoft.com/download/pr/a0832b5a-6900-442b-af79-
6ffddddd6ba4/e2df0b25dd851ee0b38a86947dd0e42e/dotnet-runtime-5.0.17-win-x64.exe" -UseBasicParsing- 
OutFile "dotnet-runtime-5.0.17-win-x64.exe" 

RUN dotnet-runtime-5.0.17-win-x64.exe /quiet /install
RUN powershell.exe [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\
Invoke-WebRequest "https://download.visualstudio.microsoft.com/download/pr/3789ec90-2717-424f-8b9c-
3adbbcea6c16/2085cc5ff077b8789ff938015392e406/aspnetcore-runtime-5.0.17-win-x64.exe" -UseBasicParsing-
OutFile "aspnetcore-runtime-5.0.17-win-x64.exe"

# 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 ".\appmanager" -
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 

#RUN setx path "%path%;.\Program Files\dotnet\"
RUN setx path "%path%;C:\Program Files (x86)\dotnet\"


WORKDIR /app 

#ENTRYPOINT ["powershell.exe",".\\Program Files\\dotnet\\dotnet.exe", ".\\ASPNETWebApp.dll"]
ENTRYPOINT ["powershell.exe"]
CMD ["dotnet", "\\ASPNET5WebApp.dll", "--urls", "http://*:5000"]

After Docker start,

  • Access the docker container and configure the application filters from the agent installed "./appmanager" path.
  • Start or Restart the .NET Core application. Perform some transactions to start monitoring.

Loved by customers all over the world

"Standout Tool With Extensive Monitoring Capabilities"

It allows us to track crucial metrics such as response times, resource utilization, error rates, and transaction performance. The real-time monitoring alerts promptly notify us of any issues or anomalies, enabling us to take immediate action.

Reviewer Role: Research and Development

carlos-rivero
"I like Applications Manager because it helps us to detect issues present in our servers and SQL databases."
Carlos Rivero

Tech Support Manager, Lexmark

Trusted by over 6000+ businesses globally