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

Installation

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

  1. Run the following command, replacing 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, the settings have to be formatted as a here-string.

--settings @'"{\"tenantId\":\"<Environment-ID>\",\"token\":\"<API-Token>\"}"'@
Parameter Required Description
Resource-Group yes Name of the resource group the Virtual Machine is deployed to
VMSS-Name yes Name of the VMSS the extension should be installed to.
Extension-Type yes For Windows-based Virtual Machines use oneAgentWindows. For Linux-based ones use oneAgentLinux.
tenantId yes Set environment ID as described in the Prerequisites
token yes Set API token as described in the Prerequisites
server No Optional Provide this property to configure an alternative communication endpoint. See Additional configuration parameters for more information.
enableLogAnalytics No If not set, Log Analytics isn't enabled. Set value to yes to enable Log Analytics
hostGroup No Optional Provide this property to set the hostgroup this VM belongs to. See Host Groups for more information.
  1. Update the VMSS virtual machines.
az vmss update-instances --instance-ids '*' --resource-group $CLUSTER_RESOURCE_GROUP --name $SCALE_SET_NAME

Install Dynatrace OneAgent site 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 the virtual machine is deployed to.
VMSS-Name yes Name of the VMSS the extension should be installed to.
Extension-Type yes For Windows-based virtual machines use oneAgentWindows. For Linux-based VMs use oneAgentLinux.
Extension-Version yes Required version of the extension. Current latest version is 2.3
tenantId yes Set environment ID as described in the Prerequisites.
token yes Set API token as described in the Prerequisites.
server no Optional Provide this property to configure an alternative communication endpoint. See Additional configuration parameters for more information.
enableLogAnalytics no If not set, Log Analytics isn't enabled. Set value to yes to enable Log Analytics
hostGroup no Optional Provide this property to set the hostgroup this VM belongs to. See Host Groups for more information.

Check deployment status

OneAgent starts monitoring your virtual machine immediately after installation, but it will start monitoring your application only after the application is restarted.

You can see the deployment status in your Dynatrace environment.

OneAgent deployment status

Troubleshooting