Monitor Azure Virtual Machines

Capabilities

Dynatrace provides a VM Extension to install OneAgent on Azure Virtual Machines. This enables you to leverage the native deployment automation features using Azure Resource Manager (ARM). The Dynatrace VM extension is available for Windows and Linux in all public Azure regions (including support for Classic Virtual Machines).

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 a OneAgent default version is configured.

Prerequisites

  • Create a PaaS token.

  • Determine your environment ID.

  • Determine your server URL if required.

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

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

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

Install Dynatrace OneAgent VM extension

There are several ways to install the Dynatrace OneAgent VM extension: through Azure Portal, Azure CLI, or PowerShell, or by using an ARM template. Follow the steps below for instructions.

VM extension version 2.201.1.0+

With the VM extension 2.201.1.0 release, you can set the overrideDefaults parameter via CLI and PowerShell installation and via ARM template.

  • You can set the custom timeout (overrideDefaults) for the Azure VM Extension download, which is helpful in environments with a suboptimal internet connection or smaller network throughput (bandwidth).

  • Your error messages became more informative, which is helpful in automated systems.

  • Updating the Azure VM Extension on Windows can now be done without uninstalling it first. If the OneAgent's version changes on the tenant, you just need to install the Azure VM Extension again to install this new version.

Install Dynatrace OneAgent VM extension via an ARM template

Alternatively to the main installation methods, you can make the Dynatrace VM extension part of your ARM templates.
The JSON file for a virtual machine extension can be nested inside the virtual machine resource, or placed at the root or top level of a resource manager JSON template. The placement of the JSON file affects the value of the resource name and type.

  • The following example assumes the OneAgent extension is nested inside the virtual machine resource. When nesting the extension resource, the JSON file is placed in the "resources": [] object of the virtual machine.

    {
    "type": "extensions",
    "name": "dynatrace",
    "apiVersion": "2018-06-01",
    "location": "[resourceGroup().location]",
    "dependsOn": [
    "[concat('Microsoft.Compute/virtualMachines/', <VM-Name>)]"
    ],
    "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>"
    },
    }
    }
  • When placing the extension JSON at the root of the template, the resource name includes a reference to the parent virtual machine, and the type reflects the nested configuration.

    {
    "type": "Microsoft.Compute/virtualMachines/extensions",
    "name": "<Parent-VM-Resource>/dynatrace",
    "apiVersion": "2018-06-01",
    "location": "[resourceGroup().location]",
    "dependsOn": [
    "[concat('Microsoft.Compute/virtualMachines/', <VM-Name>)]"
    ],
    "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
Parent-VM-Resource
required
Name of the parent VM resource where you want to install the extension. Not applicable when using nested resource.
VM-Name
required
Name of the VM where you want to install the extension.
Extension-Type
required
For Windows-based VMs, use oneAgentWindows. For Linux-based VMs, use oneAgentLinux.
tenantId
required
The environment ID as described in Prerequisites.
token
required
The PaaS token as described in Prerequisites. From 2.200.0.0 version, it's recommended to pass it in protectedSettings.
Extension-Version
optional
Required version of the extension.
server
optional
The server URL, if you want to configure an alternative communication endpoint as described in Prerequisites.
enableLogsAnalytics
optional
Set to yes if you want to enable Log Monitoring.
hostGroup
optional
Define the host group to which the VM belongs.
overrideDefaults 1
optional
Override the default value of the timeout—120 seconds. For example, if you want to set the timeout to 600 seconds, add \"overrideDefaults\": {\"downloadInstallerRequestTimeoutInSeconds\": 600} to the ARM template in the settings object, you can also leave it empty \"overrideDefaults\": {}, or null. In such cases, the 120 seconds default value will apply.
1

Available from VM extension version 2.201.1.0.

To check the deployment status, go to Deployment Status.

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

Configure network zones optional

To configure network zones, use the installer arguments below.

az vm extension set
--publisher dynatrace.ruxit
-n "oneAgentLinux"
-g "yourresourcegroup"
--vm-name "awesome-vm"
--settings "{\"tenantId\":\"myawesometenant\",\"token\":\"nope123\", \"installerArguments\":\"--set-host-group=example_hostgroup --set-monitoring-mode=fullstack --set-network-zone=<your.network.zone>\"}"

See network zones for more information.