Deploy OneAgent on Azure App Service

To deploy OneAgent on Azure App Service follow the instructions below.

Generate a PaaS token

The first step is to get your environment ID and generate a PaaS token for your Dynatrace environment. This information is required so we can map your Azure account to your Dynatrace account.

To get your Dynatrace environment ID and PaaS token follow the instructions below:

Environment ID

  1. Login with your Dynatrace account.

  2. Select Deploy Dynatrace from the navigation menu.

  3. Click the Set up PaaS integration button. Your environment ID appears in the Environment ID text box.

  4. Click Copy to copy the ID to the clipboard. You can do this at any time by revisiting this page.

API Token

The API token is used in combination with your environment ID to download the OneAgent installer. If you go to Deploy Dynatrace > Set up PaaS integration, you will notice that there is already a default InstallerDownload token available. However, for security reasons, it's recommended that you create discrete tokens for different environments.

To generate a new token

  1. Click the Generate new token button.

  2. 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, azure, cloud-foundry, or openshift). To view and manage your existing tokens, go to Settings -> Integration -> Platform as a Service.

  3. Click Generate to create the token. The newly created token will appear in the list below.

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

Installation

To deploy OneAgent on Azure App Service, you need to configure and install the Dynatrace Site Extension.

Configure the Dynatrace Site Extension via the Azure portal

Open portal.azure.com in a new browser window.

Navigate to the web app you want to monitor.

From Settings, select Application Settings. Then, scroll down to the App Settings area and add two new Key/Value pairs:

  • DT_TENANT: Your environment ID, as shown above.
  • DT_API_TOKEN: Copy and paste the PaaS token from the Download Dynatrace page shown above.

If you're using Dynatrace Managed, you need to configure additional settings to allow the site extension to download OneAgent from your Managed server:

  • DT_API_URL: This needs to be set to https://<YourManagedServerURL>/e/<environment-id>/api.
  • DT_SSL_MODE (optional): By default, the Dynatrace site extension validates the SSL certificate required to download the OneAgent binaries from your Dynatrace Managed server. If you use a self-signed SSL certificate on your Dynatrace Managed server, you can force the site extension to accept it by setting DT_SSL_MODE to all.

Remember to persist your changes by clicking the Save button at the top of the page.

Install the Dynatrace Azure site extension

You can install the Dynatrace Azure site extension via the Azure Portal or through Kudo.

  1. Open portal.azure.com in a new browser window.

  2. Navigate to the web app you want to monitor.

  3. Select Extensions from the list of options. You'll find this in the Development tools subsection (note the Search field at the top of the page in case you have trouble finding this option).

  4. Within the new pane (i.e., "blade" in Azure terminology) that appears on the right-hand side, click Add.

  5. Scroll through the list until you find Dynatrace OeAgent. Note that entries are not ordered alphabetically.

  6. Click OK to apply Dynatrace monitoring to your Azure website.

  7. Restart your website so that Dynatrace begins to receive monitoring data. Following restart, you should see the hosts and services that you've set up via your Azure service plan (see example below). Note that the PaaS type setting is set to Azure.

Using multiple deployment slots

As Azure App Service deployment slots are treated like full-fledged application service instances, you need to enable the Dynatrace OneAgent Site Extension for each deployment slot. For details on configuring deployment slots, see Microsoft Documentation - Staged Publishing.