Deploy OneAgent on Azure Virtual Machines
DESK provides a VM Extension to install the OneAgent on Azure Virtual Machines. This allows to leverage the native deployment automation features using Azure Resource Manager (ARM).
Besides the extension, OneAgent can still be installed manually or by using any deployment automation tooling of your choice.
How the VM-Extension for OneAgent works
The extension does not include the OneAgent installer. Instead, the extension uses the DESK REST-API to download the latest installer from the cluster, unless an OneAgent default version is configured.
Agent updates are provided automatically through the capabilities of OneAgent.
Prerequisites
To use the extension, you need the DESK Environment ID and API Token.
How to retrieve Environment ID and API Token
Environment ID
-
Login with your DESK account.
-
Select Deploy DESK from the navigation menu.
-
Click the Set up PaaS integration button. Your environment ID appears in the Environment ID text box.
-
Click Copy to copy the ID to the clipboard. You can do this at any time by revisiting this page.
API Token
The API token is used in combination with your environment ID to download OneAgent. Go to Deploy DESK > Set up PaaS integration to access the InstallerDownload token. For security reasons, it's recommended that you create a discrete token for each environment.
To generate a new token
-
Click the Generate new token button.
-
Type in a meaningful name for your token. A meaningful token name might be the name of the platform you want to monitor (for example,
azure
,cloud-foundry
, oropenshift
). To view and manage your existing tokens, go to Settings -> Integration -> Platform as a Service. -
Click Generate to create the token. The newly created token will appear in the list below.
-
Click Copy to copy the generated token to the clipboard. You can do this at any time by revisiting this page and clicking Show token next to the relevant PaaS token.
Additional configuration parameters
Server Url
If you're using DESK Managed or your communication should be routed through a specific ActiveGate, you need to configure your custom communication endpoint.
The URL pattern for the API endpoint is as follows:
https://<YourDESKServerURL>/e/<YourEnvironmentID>/api
<YourDESKServerURL>
and <YourEnvironmentID>
need to be replaced.
Installation
Azure Resource Manager provides a consistent management layer to perform tasks through Azure PowerShell, Azure CLI, Azure portal, REST API, and client SDKs.
Adding to an existing Virtual Machine
-
Navigate to an existing virtual machine
-
Select Extensions and click Add.
-
Select DESK OneAgent from the list of extensions.
-
Provide the configuration parameters as required | .
-
Click OK to start the installation process.
Define extension within the deployment wizard
When creating a new Virtual Machine, the VM-extension can be configured within the deployment wizard.
Replace all values marked with <...>
with your actual values.
az vm extension set
--publisher desk.ruxit
-n "<Extension-Type>"
-g "<Resource-Group>"
--vm-name "<VM-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. |
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 . |
tenantId | yes | Set environment ID as described in the Prerequisites. |
token | yes | Set API token as described in the Prerequisites. |
server | No | Optionally provide this property to configure an alternative communication endpoint. 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 | Optionally, provide this property to define the hostgroup that this VM belongs to. See Host Groups for more information. |
Replace all values marked with <...>
with your actual values.
Using AzureRM
Set-AzureRmVmExtension
-Name DESK
-Publisher desk.ruxit
-ResourceGroupName "<Resource-Group>"
-Location "<Location>"
-VMName "<VM-Name>"
-ExtensionType "<Extension-Type>"
-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. |
Location | yes | Location the VM is deployed to. |
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 . |
tenantId | yes | Provide the environment ID as described in the Prerequisites. |
token | yes | Provide the API token as described in the Prerequisites. |
server | No | Optionally provide this property to configure an alternative communication endpoint. 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 | Optionally, provide this property to define the hostgroup that this VM belongs to. See Host Groups for more information. |
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": "desk",
"apiVersion": "2018-06-01",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', <VM-Name>)]"
],
"properties": {
"publisher": "desk.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>/desk",
"apiVersion": "2018-06-01",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', <VM-Name>)]"
],
"properties": {
"publisher": "desk.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 | Optionally 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 | Optionally, provide this property to define the hostgroup that this VM belongs to. See Host Groups for more information. |
After OneAgent is installed, OneAgent immediately starts monitoring your virtual machine. You can check the deployment status within DESK.
VM extension availability
- The DESK VM extension is available for Windows and Linux in all public Azure regions (including support for Classic Virtual Machines)
- Coming soon: Azure Sovereign Clouds such as Azure Government, Azure China, as well as Azure Stack