Create a token to download and setup OneAgent:
Determine your environment ID.
Determine your server URL if required.
The server URL is required only if you use an ActiveGate for a Dynatrace SaaS endpoint. The URL is automatically generated from the environment ID.
https://<your-active-gate-IP-or-hostname>:9999/e/<your-environment-id>/api (the ActiveGate port is configurable)Because Azure Functions on Linux has no native extension point, OneAgent is packaged as a runtime-specific deployment dependency. Dynatrace provides packages for all supported runtimes, meaning no changes to your function code are required.
Use the setup wizard in Dynatrace to generate configuration values tailored to your runtime and Dynatrace environment.
Open the deployment wizard from one of these entry points:
Dynatrace Hub, select Azure Functions > Set up.
Discovery & Coverage, Services,
Distributed Tracing, or
Fleet Management, select Azure Functions.Then complete the wizard:
The wizard generates:
Add the environment variables from the wizard to your function app's Application Settings. You can do this in the Azure portal under Settings > Configuration > Application Settings, or use the Azure CLI snippet the wizard provides.
The variables configure:
Dynatrace connection.
Variables: DT_TENANT, DT_CLUSTER, DT_CONNECTION_BASE_URL, DT_CONNECTION_AUTH_TOKEN.
These variables identify your Dynatrace environment and authenticate OneAgent.
Runtime startup hook.
Variable: languageWorkers__python__arguments for Python, with an equivalent for each runtime.
This variable registers OneAgent with the language runtime before your function executes. It enables automatic instrumentation at runtime, so you don't need to modify your function code.
Store DT_CONNECTION_AUTH_TOKEN as an Azure Key Vault secret and reference it in your Application Settings rather than pasting the token value directly. This reduces the risk of unintentionally leaking the token.
Add the runtime-specific OneAgent package as a dependency in your project using the version the wizard specifies. For example, for Python:
pip install dynatrace-oneagentpython==<version>pip freeze > requirements.txt
Redeploy your function app. Azure Functions installs the package automatically during deployment, and OneAgent starts monitoring from the first invocation.