This tutorial helps you quickly deploy the Dynatrace OneAgent product to Azure Container Apps, allowing you to monitor various resource metrics in real-time.
TOC
- Introduction
- Setup
- References
1. Introduction
Dynatrace OneAgent is an advanced monitoring tool that automatically collects performance data across your entire IT environment. It provides deep visibility into applications, infrastructure, and cloud services, enabling real-time observability. OneAgent supports multiple platforms, including containers, VMs, and serverless architectures, ensuring seamless monitoring with minimal configuration. It captures detailed metrics, traces, and logs, helping teams diagnose performance issues, optimize resources, and enhance user experiences. With AI-driven insights, OneAgent proactively detects anomalies and automates root cause analysis, making it an essential component for modern DevOps, SRE, and cloud-native monitoring strategies.
2. Setup
1. After registering your account, go to the control panel and search for Deploy OneAgent.
2. Obtain your Environment ID and create a PaaS token. Be sure to save them for later use.
3. In your local environment's console, log in to the Dynatrace registry.
docker login -u XXX XXX.live.dynatrace.com # XXX is your Environment ID
# Input PaaS Token when password prompt
4. Create a Dockerfile and an sshd_config file.
FROM mcr.microsoft.com/devcontainers/javascript-node:20
# Change XXX into your Environment ID
COPY --from=XXX.live.dynatrace.com/linux/oneagent-codemodules:all / /
ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
# SSH
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog openssh-server tzdata screen lrzsz htop cron \
&& echo "root:Docker!" | chpasswd \
&& mkdir -p /run/sshd \
&& chmod 700 /root/.ssh/ \
&& chmod 600 /root/.ssh/id_rsa
COPY ./sshd_config /etc/ssh/
# OTHER
EXPOSE 2222
CMD ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]
Port 2222
ListenAddress 0.0.0.0
LoginGraceTime 180
X11Forwarding yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
MACs hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
Subsystem sftp internal-sftp
AllowTcpForwarding yes
5. Build the container and push it to Azure Container Registry (ACR).
# YYY is your ACR name
docker build -t oneagent:202503201710 . --no-cache # you could setup your own image name
docker tag oneagent:202503201710 YYY.azurecr.io/oneagent:202503201710
docker push YYY.azurecr.io/oneagent:202503201710
6. Create an Azure Container App (ACA), set Ingress to port 3000, allow all inbound traffic, and specify the ACR image you just created.
7. Once the container starts, open a console and run the following command to create a temporary HTTP server simulating a Node.js app.
mkdir app && cd app
echo 'console.log("Node.js app started...")' > index.js
npm init -y
npm install express
cat <<EOF > server.js
const express = require('express');
const app = express();
app.get('/', (req, res) => res.send('hello'));
app.listen(3000, () => console.log('Server running on port 3000'));
EOF
# Please Press Ctrl + C to terminate the next command and run again for 3 times
node server.js
8. You should now see the results on the ACA homepage.
9. Go back to the Dynatrace control panel, search for Host Classic, and you should see the collected data.
3. References
Integrate OneAgent on Azure App Service for Linux and containers — Dynatrace Docs
Updated Mar 20, 2025
Version 1.0theringe
Microsoft
Joined April 08, 2022
Apps on Azure Blog
Follow this blog board to get notified when there's new activity