Send Devolutions Server logs to Azure Log Analytics
Devolutions Server can send its activity and administration logs to an Azure Log Analytics workspace through the Azure Monitor Logs ingestion API. This article describes how to create the Azure components, how to configure Devolutions Server, and how to verify the result: a custom table in which each log entry is a row with its user, entry, vault, and machine in separate columns.
Before you begin
An Azure subscription with a Log Analytics workspace.
In Azure, the permissions to:
Register an application in Microsoft Entra ID.
Create tables in the Log Analytics workspace (at least contributor rights on the workspace).
Create data collection endpoints and data collection rules (for example, the Monitoring Contributor role).
Assign roles on the data collection rule.
A Devolutions Server administrator account, or a user with the administrative permission to edit the Logging server settings.
Logs sent to Azure
Devolutions Server sends the entries of the connection logs only:
Activity entries, which are linked to an entry, such as opening a session or viewing a password.
Administration entries, which are not linked to an entry.
Entries of user vaults are sent only when Log user vault activities is enabled in Administration – System settings – General. Other logs of Devolutions Server are not sent. If you have audit requirements, confirm that this subset covers them before using it as your only audit trail.
How the components fit together
Devolutions Server authenticates with an Azure app registration, then posts the logs to a Data Collection Endpoint (DCE). The Data Collection Rule (DCR) receives them in its stream, transforms them with a KQL query, and writes the result in the custom table of the Log Analytics workspace.
Each field of the Azure log analytics section of Devolutions Server takes a value from Azure:
Azure endpoint
Logs ingestion URI of the DCE
Monitor – Data Collection Endpoints – the DCE – Overview
Immutable ID
immutableId of the DCR, which starts with dcr-
Monitor – Data collection rules – the DCR – Overview – JSON View
Azure log analytics stream name
Name of the DCR stream, such as Custom-Devolutions_Logs_CL
JSON View of the DCR, under streamDeclarations
Azure log analytics tenant ID
Directory (tenant) ID
Microsoft Entra ID – App registrations – the application – Overview
Azure log analytics client ID
Application (client) ID
Microsoft Entra ID – App registrations – the application – Overview
Azure log analytics client secret
Value of the client secret
Certificates & secrets of the application, displayed only when the secret is created
Log format sent by Devolutions Server
Devolutions Server sends each log entry with three top-level fields only:
TimeGenerated(datetime): The time at which the entry was sent.Event(dynamic): The log entry itself, with the event time (@t),ReportType(ActivityorAdministration),MachineName(the Devolutions Server machine), and aPropertiesobject that holds the details of the entry. Empty values are left out ofProperties.Message(string): The rendered log message.
The stream of the DCR must declare these three fields, and the transformation must read the values inside Event. Otherwise, rows are created in the table, but all their fields are empty.
Set up Azure Log Analytics
Register an application
In the Azure portal, go to Microsoft Entra ID – App registrations.
Click New registration.
Enter a name for the application.
Under Supported account types, keep Accounts in this organizational directory only.
Click Register. A redirect URI is not required.
On the Overview page of the application, copy the Application (client) ID and the Directory (tenant) ID.
Create a client secret
In the application, go to Certificates & secrets.
Click New client secret.
Enter a description and select an Expires duration.
Click Add.
Copy the Value of the secret, not its Secret ID. The value cannot be displayed again after you leave the page.
Create a Data Collection Endpoint
In the Azure portal, go to Monitor – Data Collection Endpoints.
Click Create.
Enter a name, and select the subscription, the resource group, and the region of the Log Analytics workspace.
Click Create.
Open the DCE.
On its Overview page, copy the Logs ingestion URI.
Create the table and the Data Collection Rule
The New custom log (DCR based) wizard creates the table and the DCR together. It builds the stream of the DCR from a sample file, so the sample must have the format sent by Devolutions Server.
Save the following content in a file named
sample.json:In the Azure portal, go to Log Analytics workspaces and open the workspace.
Go to Tables.
Click Create – New custom log (DCR based).
Enter a table name, such as
Devolutions_Logs. The portal adds the_CLsuffix.Click Create a new data collection rule.
Select the Subscription and the Resource group, and enter a Name for the DCR.
Select the DCE in the data collection endpoint list.
Click Next.
Click Browse for files and select
sample.json.Confirm that the preview contains exactly the
TimeGenerated,Event, andMessagecolumns.Click Transformation editor.
Replace the query with the following transformation:
Click Run and confirm that the
ReportTypeandUsercolumns contain values.Click Apply.
Click Next.
Click Create.
The transformation starts with source, which represents the incoming stream, and uses the event time of the log entry as TimeGenerated. The table is created with the following columns:
TimeGenerated
datetime
Time of the event
ReportType
string
Activity or Administration
MachineName
string
Devolutions Server machine that sent the entry
User
string
User who performed the action
ConnectionName
string
Name of the entry
ConnectionId
string
ID of the entry
VaultName
string
Name of the vault
VaultId
string
ID of the vault
Message
string
Log message
LogDate
string
Creation date of the log entry
ConnectionType
string
Type of the entry
ConnectionUsername
string
Username of the entry
Machine
string
Machine of the user
Ticket
string
Ticket number
ActiveTime
string
Active time of the session
OnOpenComment
string
Comment entered when the session was opened
OnCloseComment
string
Comment entered when the session was closed
Copy the immutable ID and the stream name
The immutable ID and the stream name are properties of the DCR, not of the table.
In the Azure portal, go to Monitor – Data collection rules.
Open the DCR created with the table.
On its Overview page, click JSON View.
Copy the value of
immutableId.Copy the name of the stream declared under
streamDeclarations, such asCustom-Devolutions_Logs_CL.
Assign the role on the Data Collection Rule
In the DCR, go to Access control (IAM).
Click Add role assignment.
Select Monitoring Metrics Publisher.
Click Next.
For Assign access to, select User, group, or service principal.
Click Select members.
Select the registered application.
Click Select.
Click Review + assign.
Microsoft indicates that a role assignment can take up to 30 minutes to apply. For more information, consult the Microsoft tutorial on the Logs ingestion API.
Configure Devolutions Server
In the Devolutions Server web interface, go to Administration – Server settings – Logging.
In the Azure log analytics section, check Enable Azure logging.
In Azure endpoint, enter the Logs ingestion URI of the DCE.
In Immutable ID, enter the
immutableIdof the DCR.In Azure log analytics stream name, enter the stream name of the DCR, with its
Custom-prefix.In Azure log analytics tenant ID, enter the Directory (tenant) ID of the application.
In Azure log analytics client ID, enter the Application (client) ID of the application.
In Azure log analytics client secret, enter the Value of the client secret.
Click Test connection.
Click Save at the top right of the page.
The settings apply when they are saved, without restarting Devolutions Server. Unchecking Enable Azure logging and saving clears all the values of the Azure log analytics section.
Verify that the logs are received
Generate an activity entry, for example by opening an entry of the Devolutions Server data source from Remote Desktop Manager, or by viewing the password of an entry in the Devolutions Server web interface.
In the Azure portal, go to Log Analytics workspaces and open the workspace.
Go to Logs.
Run the following query, with the name of the table:
Confirm that the
ReportTypeandUsercolumns contain values.
New rows can take a few minutes to appear, and the first rows of a new table can take longer.
Troubleshooting
The table stays empty, even though Test connection succeeds.
The stream name, the immutable ID, or the endpoint entered in Devolutions Server does not match the DCR and the DCE. Test connection does not check these values.
Copy the immutableId and the stream name again from the JSON View of the DCR, and the Logs ingestion URI from the DCE. The stream name includes the Custom- prefix. Click Save.
The table stays empty, and the values entered in Devolutions Server are correct.
The registered application does not have the Monitoring Metrics Publisher role on the DCR, or the role assignment is not applied yet.
In the DCR, verify the role assignment in Access control (IAM). Wait up to 30 minutes after assigning the role.
The table stays empty, and no action generated a log entry.
Only connection log entries are sent. User vault entries are sent only when Log user vault activities is enabled.
Open an entry from Remote Desktop Manager or view a password in the web interface. For user vault entries, enable Log user vault activities in Administration – System settings – General.
Rows are created, but all their fields are empty.
The DCR stream does not declare TimeGenerated, Event, and Message, or the transformation reads flat columns instead of the values inside Event. This happens when the table was created from a different sample.
Replace the stream columns and the transformKql of the DCR through its Export template, or recreate the table and the DCR from sample.json.
Some columns are empty on some rows only.
Devolutions Server leaves empty values out of Properties. Administration entries are not linked to an entry, so the entry columns are empty.
No fix is required.
Test connection fails.
The tenant ID, the client ID, or the client secret is incorrect, or the client secret has expired. The client secret field expects the Value of the secret, not its Secret ID.
Verify the IDs on the Overview page of the application. Create a new client secret if needed, enter its Value, and click Save.
Logs stopped arriving after working for some time.
The client secret has expired, so Devolutions Server can no longer authenticate.
Create a new client secret in the application, enter its Value in Azure log analytics client secret, and click Save.
To check whether the DCR receives data, consult the DCR metrics, such as Logs Rows Received per Min and Logs Transformation Errors per Min. For more information, consult the Microsoft documentation on DCR monitoring.
Fix an existing configuration
A table and a DCR created with a different sample or transformation can be corrected without being recreated. The JSON View of the DCR is read-only, so the DCR is modified through its template:
In the Azure portal, open the DCR.
Click Export template.
Click Deploy.
Click Edit template.
In
streamDeclarations, set the columns of the stream toTimeGenerated(datetime),Event(dynamic), andMessage(string):In
dataFlows, replace the value oftransformKqlwith the transformation, on a single line:Click Save. Do not change the parameter values.
Click Review + create.
Click Create.
The table must contain every column produced by the transformation: TimeGenerated (datetime) and the other 16 columns (string). Add any missing column to the table schema. The DCR can also be deployed from a JSON file with the Azure CLI (az monitor data-collection rule create) or PowerShell (New-AzDataCollectionRule). For more information, consult the Microsoft documentation on editing a DCR. Changes to a DCR can take several minutes to apply.
Last updated
Was this helpful?