Monitor Azure Virtual Machines
Capabilities
Full-stack monitoring powered by OneAgent
- Extensions for easy deployment of OneAgent
- Integration with Azure Monitor
Enhanced support for Azure VM metadata such as Azure regions, scale sets and more
- Classic Virtual Machines are also supported
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.
Add the extension to an existing VM
In Azure Portal, go to an existing virtual machine where you want to add the OneAgent extension.
- In the left menu, go to Settings and select Extensions.
- Select Add.
- Select Choose extension.
- From the list of extensions, select Dynatrace OneAgent.
- Select Create to add the extension.
- On the Install extension page, enter your environment ID, your API token, and your server URL. See Prerequisites for details.
Select whether you want to enable Log Monitoring.
- optional Define the host group to which the VM belongs.
- Select OK.
- 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.
Add the extension to a new VM
- During the creation of a new VM in the deployment wizard, in Advanced, select Select an extension.
- Select Dynatrace OneAgent.
- Select Create.
- On the Install extension page, enter your environment ID, your API token, and your server URL. See Prerequisites for details.
Select whether you want to enable Log Monitoring.
- optional Define the host group to which the VM belongs.
- Select OK.
Continue VM configuration in the deployment wizard.
- Select Review and create.
- 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.
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.
1{2 "type": "extensions",3 "name": "dynatrace",4 "apiVersion": "2018-06-01",5 "location": "[resourceGroup().location]",6 "dependsOn": [7 "[concat('Microsoft.Compute/virtualMachines/', <VM-Name>)]"8 ],9 "properties": {10 "publisher": "dynatrace.ruxit",11 "type": "<Extension-Type>",12 "typeHandlerVersion": "<Extension-Version>",13 "autoUpgradeMinorVersion": true,14 "settings": {15 "tenantId": "<Environment-ID>",16 "token": "<API-Token>",17 "server": "<Server-Url>",18 "enableLogAnalytics": "yes",19 "hostGroup": "<Host-Group>"2021 },22 }23} -
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.
1{2 "type": "Microsoft.Compute/virtualMachines/extensions",3 "name": "<Parent-VM-Resource>/dynatrace",4 "apiVersion": "2018-06-01",5 "location": "[resourceGroup().location]",6 "dependsOn": [7 "[concat('Microsoft.Compute/virtualMachines/', <VM-Name>)]"8 ],9 "properties": {10 "publisher": "dynatrace.ruxit",11 "type": "<Extension-Type>",12 "typeHandlerVersion": "<Extension-Version>",13 "autoUpgradeMinorVersion": true,14 "settings": {15 "tenantId": "<Environment-ID>",16 "token": "<API-Token>",17 "server": "<Server-Url>",18 "enableLogAnalytics": "yes",19 "hostGroup": "<Host-Group>"20 }2122 }23}
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. |
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.
Configure network zones optional
To configure network zones, use the installer arguments below.
1az vm extension set2 --publisher dynatrace.ruxit3 -n "oneAgentLinux"4 -g "yourresourcegroup"5 --vm-name "awesome-vm"6 --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.