Try it free

Monitor Azure Functions on Linux plans (Dynatrace Classic)

  • Dynatrace Classic
  • How-to guide
  • 3-min read

Prerequisites

  • 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.

    • ActiveGate server URL:
      https://<your-active-gate-IP-or-hostname>:9999/e/<your-environment-id>/api (the ActiveGate port is configurable)

.NET on Linux plans

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.

Set up monitoring

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.

Step 1: Open the setup wizard

Open the deployment wizard from one of these entry points:

  • In Hub Dynatrace Hub, select Azure Functions > Set up.
  • On the onboarding page of Discovery & Coverage Discovery & Coverage, Services, Distributed Traces Distributed Tracing, or Fleet Management Fleet Management, select Azure Functions.

Then complete the wizard:

  1. Select your runtime (Python or .NET).

  2. Select your Azure Functions hosting option (for example, Linux Flex Consumption).

  3. Enter your Resource group and Function app name. The wizard uses them to generate valid commands and settings.

The wizard generates:

  • The environment variables (set via Azure Function Application Settings) to configure your function app.
  • The exact package version to install.

Step 2: Apply environment variables

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.

Step 3: Add the OneAgent package and redeploy

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.

Related topics

  • Monitor Azure Functions on Plans for Windows (Dynatrace Classic)
  • Serverless compute support matrix
Related tags
Infrastructure Observability