Create an API token with the InstallerDownload, DataExport, and agentTokenManagement.read scopes to download and set up 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)If you instrumented your .NET functions by following Trace Azure Functions written in .NET, remove using Dynatrace.OpenTelemetry* from your software and all other code you added based on that instruction.
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:
Select your runtime (Python or .NET).
Select your Azure Functions hosting option (for example, Linux Flex Consumption).
Enter your Resource group and Function app name. The wizard uses them to generate valid commands and settings.
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 environment variables register OneAgent with the language runtime before your function executes. They enable 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.
Redeploy your function app. Azure Functions installs the package automatically during deployment, and OneAgent starts monitoring from the first invocation.