Integrate OneAgent on Azure Virtual Machine Scale Set

Dynatrace provides a VM extension to install OneAgent on Azure Virtual Machine Scale Set (VMSS). The extension doesn't include the OneAgent installer. Instead, it uses the Dynatrace REST API to download the latest version from the cluster, unless a default OneAgent version is configured. OneAgent updates are provided automatically.

Prerequisites

The server URL is required only if you use either of the following:

  • a Dynatrace Managed endpoint
  • an ActiveGate for a Dynatrace Managed or Dynatrace SaaS endpoint
    If you use Dynatrace SaaS, the URL is automatically generated from the environment ID.

The server URL for Dynatrace Managed:

https://{your-domain}/e/{your-environment-id}/api

The server URL for ActiveGate:

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

Note: If you're using Dynatrace Managed or your cluster traffic should be routed through an ActiveGate, you need to configure the API endpoint used by the extension for downloading OneAgent.

Installation

The Dynatrace VM extension is available for Windows and Linux in all public Azure regions.

  1. Run the command below.
    Note: Replace all values marked with <...> with your actual values.
az vmss extension set
  --publisher dynatrace.ruxit
  -n "<Extension-Type>"
  -g "<Resource-Group>"
  --vmss-name "<VMSS-Name>"
  --settings "{\"tenantId\":\"<Environment-ID>\",\"token\":\"<API-Token>\", \"server\":\"<Server-Url>\", \"enableLogAnalytics\":\"yes\", \"hostGroup\":\"<Host-Group>\"}"

Note: When using the Azure CLI within PowerShell, you need to format the settings as a here-string.

--settings @'"{\"tenantId\":\"<Environment-ID>\",\"token\":\"<API-Token>\"}"'@
Parameter Required Description
Resource-Group yes Name of the resource group on which the VM is deployed.
VMSS-Name yes Name of the VMSS where you want to install the extension.
Extension-Type yes For Windows-based VMs, use oneAgentWindows. For Linux-based VMs, use oneAgentLinux.
tenantId yes The environment ID as described in Prerequisites.
token yes The PaaS token as described in Prerequisites.
server No optional The server URL, if you want to configure an alternative communication endpoint as described in Prerequisites.
enableLogAnalytics No Set to yes if you want to enable Log Monitoring.
hostGroup No optional Define the host group to which the VM belongs.
  1. Update the VMSS virtual machines.
az vmss update-instances --instance-ids '*' --resource-group $CLUSTER_RESOURCE_GROUP --name $SCALE_SET_NAME
  1. To check the deployment status, in your Dynatrace environment, go to Manage and select Deployment status.

After installation is complete, restart your applications on the VMs. Immediately after restart, OneAgent will begin monitoring them.

Install Dynatrace OneAgent VM extension via an ARM template

Alternatively to the main installation methods, you can make the Dynatrace site extension part of your ARM templates.

  1. Place the JSON configuration for a virtual machine extension in the VMSS resource, under extensions in extensionProfile.

Example:

{
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "sku": {...},
  "name": "<VMSS-Name>",
  "apiVersion": "2018-06-01",
  "location": "centralus",
  "properties": {
    "upgradePolicy": {...},
    "virtualMachineProfile": {
      "osProfile": {...},
      "storageProfile": {...},
      "networkProfile": {...},
      "extensionProfile": {
        "extensions": [
          {
            "name": "dynatrace",
            "properties": {
              "publisher": "dynatrace.ruxit",
              "type": "<Extension-Type>",
              "typeHandlerVersion": "<Extension-Version>",
              "autoUpgradeMinorVersion": true,
              "settings": {
                "tenantId": "<Environment-ID>",
                "token": "<API-Token>",
                "enableLogAnalytics": "yes"

              }
            }
          }
        ]
      }
    }
  }
}
  1. Configure the JSON file.
{
  "name": "dynatrace",
  "properties": {
    "publisher": "dynatrace.ruxit",
    "type": "<Extension-Type>",
    "typeHandlerVersion": "<Extension-Version>",
    "autoUpgradeMinorVersion": true,
    "settings": {
        "tenantId": "<Environment-ID>",
        "token": "<API-Token>",
        "server": "<Server-Url>",
        "enableLogAnalytics": "yes",
        "hostGroup": "<Host-Group>"
    },
  }
}

Parameter Required Description
Resource-Group yes Name of the resource group on which the VM is deployed.
VMSS-Name yes Name of the VMSS where you want to install the extension.
Extension-Type yes For Windows-based VMs, use oneAgentWindows. For Linux-based VMs, use oneAgentLinux.
Extension-Version yes Required version1 of the extension.
tenantId yes The environment ID as described in Prerequisites.
token yes The PaaS token as described in Prerequisites.
server no optional The server URL, if you want to configure an alternative communication endpoint as described in Prerequisites.
enableLogAnalytics no Set to yes if you want to enable Log Monitoring.
hostGroup no optional Define the host group to which the VM belongs.
1

To fetch the list of extension versions, run

az vm extension image list --name oneAgentLinux --publisher dynatrace.ruxit
  1. To check the deployment status, in your Dynatrace environment, go to Manage and select Deployment status.

After installation is complete, restart your applications on the VM. Immediately after restart, OneAgent will begin monitoring them.

Troubleshooting