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
- Create a PaaS Token.
- Configure the server URL.
Installation
The Dynatrace VM extension is available for Windows and Linux in all public Azure regions.
- 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. |
- Update the VMSS virtual machines.
az vmss update-instances --instance-ids '*' --resource-group $CLUSTER_RESOURCE_GROUP --name $SCALE_SET_NAME
- Apply the extension to the VM Scale Set definition, replacing all values marked with
<...>
with your actual values.
$vmss = Get-AzureRmVmss -ResourceGroupName "<Resource-Group>" -VMScaleSetName "<VMSS-Name>"
Add-AzureRmVmssExtension
-VirtualMachineScaleSet $vmss
-Name dynatrace
-Publisher dynatrace.ruxit
-Type "<Extension-Type>"
-Settings @{ "tenantId"="<Environment-ID>"; "token"="<API Token>";"server"="<Server-Url>"; "enableLogAnalytics"="yes"; "hostGroup"="<Host-Group>"; }
- Update the VMSS virtual machines with the new definition.
Update-AzureRmVmss
-VirtualMachineScaleSet $vmss
-ResourceGroupName "<Resource-Group>"
-Name "<VMSS-Name>"
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. |
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.
- Place the JSON configuration for a virtual machine extension in the VMSS resource, under
extensions
inextensionProfile
.
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"
}
}
}
]
}
}
}
}
- 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.