Azure Functions support is currently in Early Adopter release and provides only limited support for pre-compiled Azure Functions that are written in .NET, running on Windows, and operated on an "App Service Plan".
Dynatrace provides an Azure Site-Extension to install OneAgent on Azure Functions. Site Extensions are the native extension mechanism provided via Kudu, which is the deployment management engine behind Azure App Services.
How the Site Extension for OneAgent works
The extension doesn't include the OneAgent installer. Instead, the extension uses the Dynatrace REST-API to download the latest installer from the cluster, unless an OneAgent default version is configured.
Agent updates aren't automatically provided through OneAgent. For more information on how updates are applied, see How to update OneAgent on App Services.
To use the extension, you need your Dynatrace Environment ID and API Token.
How to retrieve your environment ID and API Token
Login with your Dynatrace account.
Select Deploy Dynatrace from the navigation menu.
Click the Set up PaaS integration button. Your environment ID appears in the Environment ID text box.
Click Copy to copy the ID to the clipboard. You can do this at any time by revisiting this page.
The API token is used in combination with your environment ID to download OneAgent. Go to Deploy Dynatrace > Set up PaaS integration to access the InstallerDownload token. For security reasons, it's recommended that you create a discrete token for each environment.
To generate a new token
Click the Generate new token button.
Type in a meaningful name for your token. A meaningful token name might be the name of the platform you want to monitor (for example,
openshift). To view and manage your existing tokens, go to Settings -> Integration -> Platform as a Service.
Click Generate to create the token. The newly created token will appear in the list below.
Click Copy to copy the generated token to the clipboard. You can do this at any time by revisiting this page and clicking Show token next to the relevant PaaS token.
Additional configuration parameters
If you're using Dynatrace Managed or your cluster traffic is routed through an ActiveGate, you need to configure the communication endpoint used by the extension.
<YourEnvironmentID> need to be replaced. The URL pattern for the API endpoint is as follows:
Install the Site Extension for OneAgent
Navigate to the Azure Function Service where you want to add OneAgent.
Under the tab Platform features select Site Extensions and click Add.
Select Dynatrace OneAgent from the list of extensions.
Accept the legal terms and click OK, so the extension is installed.
To activate and access the extension you need to restart Kudu.
Configure the Site Extension for OneAgent
The extension comes with its own UI for easier configuration.
- Access the extensions UI through either the "Browse" link in the portal...
...or directly by browsing to the extension using
For more details on how to access the Kudu service and its extensions see Accessing the Kudu service.
Apply the configuration as required
Click Install OneAgent and monitor progress/status until OneAgent is installed.
While Azure Function support is in Early Adopter release you need to configure some Application settings manually to enable the deep monitoring of your Azure Functions.
The required settings are shown in the extensions UI
- Finally, you need to restart the function to recycle the function's worker process, allowing OneAgent to monitor your application.
Note: To reliably restart your function processes, use Stop/Start.
Create Custom Services for your Functions
During Early Adopter release, you're required to create a custom service for your Azure Functions.
A typical Azure Functions has a "Run" method with a signature like this:
public static System.Threading.Tasks.Task'1<System.Net.Http.HttpResponseMessage> Run System.Net.Http.HttpRequestMessage, System.String, Microsoft.Azure.WebJobs.Host.TraceWriter) (Html-Triggered-Function)
Overriding OneAgent configuration
The following parameters can be used to set/override default configurations
|DT_CONNECTION_POINT||Semi-colon separated list of communication-endpoints|