Integrate OneAgent on Azure Virtual Machines

Dynatrace provides a VM Extension to install OneAgent on Azure Virtual Machines. This allows to leverage the native deployment automation features using Azure Resource Manager (ARM).

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.

Azure Site-Extension

Agent updates are provided automatically through the capabilities of OneAgent.

Prerequisites

Additional configuration parameters

Server URL
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.

<YourDynatraceServerURL> and <YourEnvironmentID> need to be replaced. The URL pattern for the API endpoint is as follows: https://<YourDynatraceServerURL>/e/<YourEnvironmentID>/api

Optional Network zones
To configure network zones, use the following installer arguments:

az vm extension set​
  --publisher dynatrace.ruxit​
  -n "oneAgentLinux"​
  -g "yourresourcegroup"​
  --vm-name "awesome-vm"​
  --settings "{\"tenantId\":\"myawesometenant\",\"token\":\"nope123\", \"installerArgs\":\"--set-host-group=example_hostgroup --set-infra-only=false --set-network-zone=<your.network.zone>\"}"

See network zones for more information.

Install Dynatrace OneAgent site extension

The Dynatrace VM extension is available for Windows and Linux in all public Azure regions (including support for Classic Virtual Machines).

Add the extension to an existing VM

  1. Navigate to an existing virtual machine.

  2. Select Extensions > Add.

  3. Select Dynatrace OneAgent from the list of extensions.

  4. Provide the configuration parameters as required. install-config-extension

  5. Select OK to start the installation process.

Add the extension to a new VM

Use the deployment wizard to configure the VM extension during the creation of a new VM.

deployment-wizard

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.
The JSON 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 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 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 yes Name of the parent VM resource the extension should be installed. Not applicable when using nested resource.
VM-Name yes Name of the VM the extension should be installed.
Extension-Type yes For Windows-based Virtual Machines use oneAgentWindows. For Linux-based ones use oneAgentLinux.
Extension-Version yes Required version of the extension. Current latest version is: 2.3
tenantId yes Provide the environment ID as described in the Prerequisites.
token yes Provide the API token as described in the Prerequisites
server no Optional Provide this property to configure an alternative API endpoint to download the OneAgent installer. See Additional configuration parameters for more information.
enableLogsAnalytics no If not set, Log Monitoring isn't enabled. Set value to yes to enable Log Monitoring
hostGroup no Optional Provide this property to define the hostgroup that 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