Skip to content

Azure Log Analytics Audit Writer

Overview

The Azure Log Analytics audit writer can be used to send audit entries to a specific Azure Log Analytics workspace.

Sent entries will contain the message of individual audit entries as a JSON formatted message.

NOTE

Due to limitations of the Azure Monitor API where API calls are limited to 1MB, some audit messages that contain entity details (such as connector import audit messages) may fail to submit.

Configuration

The Azure Log Analytics audit writer requires the following by way of configuration:

image

AttributeSupports ReferencesDescription
NamenoThe display name of the audit writer which is used for identification throughout UNIFYConnect.
Writer TypenoThe type of the writer to use.Legacy uses the HTTP Data Collector API. DCR uses Data Collection Rules through the Logs Ingestion API.
Workspace IDyesThe workspace ID of the Azure Log Analytics workspace.Required if Writer Type is set to Legacy
Shared KeyyesThe shared key allows access to the workspace.Required if Writer Type is set to Legacy
Log TypeyesThe log type to use.Required if Writer Type is set to Legacy
Data Collection EndpointyesThe Data Collection Endpoint URI for Azure Log Analytics.Required if Writer Type is set to DCR
Data Collection Rule IDyesThe Data Collection Rule ID for Azure Log Analytics.Required if Writer Type is set to DCR
Data Collection Stream NameyesThe Data Collection Stream Name for Azure Log Analytics.Required if Writer Type is set to DCR
Auth Client IDyesThe Client ID for Azure Log Analytics authentication.Required if Writer Type is set to DCR
Auth Client SecretyesThe Client Secret for Azure Log Analytics authentication.Required if Writer Type is set to DCR
Auth Tenant IDyesThe Tenant ID for Azure Log Analytics authentication.Required if Writer Type is set to DCR

Azure Log Analytics Audit Writer (DCR) Setup Guide

The steps required to set up a DCR audit writer are as follows:

  1. Create a Microsoft Entra App Registration / Service Principal
  2. Create Data Collection Endpoint (DCE)
  3. Create a custom table in LAW (DCR-based). Data Collection Rule (DCR) (can be reused for multiple UNIFY tables)
  4. Role assignment on the DCR for that service principal
  5. Configure Azure Log Analytics audit Writer for use with DCR API.

Prerequisites

  • A Log Analytics workspace
  • Ensure you have at least contributor rights to create DCE/DCR/table resources in that workspace.

Create a Microsoft Entra App Registration

Create an Application registration to authenticate against the API

  • In Azure Portal, on the Microsoft Entra ID menu, select App registration > New Registration.
    create app registrations
  • Fill in the application name; no need for a Redirect URI.
    register an application
  • After registering the application, take note of the Application (client) ID and the Directory (tenant) ID, which we will need when setting up the audit writer.
    new application registration
  • Generate the application client secret, and take note of the secret value.Select Certificates & secrets > New client secret
    add a client secretcreated client secrets

Create Data Collection Endpoint (DCE)

  • Create the data collection endpoint by selecting Monitor > Data Collection Endpoint > Create
    create dce buttoncreate dce form
  • After the creation, take note of the Logs Ingestion from the overview page.
    created dce

Create a custom table in the Log analytics workspace (DCR-based)

  • On the Log Log Analytics workspaces menu, Select Tables > New custom log (DCR based)
    create workspace

  • Enter the table's name, and select Create a new data collection rule.
    new dcr

  • Select the Data collection endpoint that we created previously and select Next.
    set data collection endpoint

  • Now, we need to upload a file with a sample JSON of what a typical audit log entry from Unify Connect looks like. This will allow Azure to infer and configure the table schema.Use the JSON sample below of an audit log entry.
    upload log file

    json
    { 
      "Id": "838d8fdc-092e-4ef1-9b5b-37f0a240fc90",
      "LogTime": "2026-03-04T11:25:00Z",
      "Initiator": {},
      "Target": {},
      "Action": {},
      "Observer": {},
      "Scope": []
    }
  • After successfully uploading the JSON sample, we need to add a transformation to create a TimeGenerated mapping it from our JSON payload. Select Transformation Editor
    transformation editor

  • Add the following transformation and select Run to run the transformation, and then select Apply
    image

    kql
    source | extend TimeGenerated = LogTime
  • Select Create to finalize the table creation

  • Now, the new DCR can be found listed under Monitor > Data Collection Rules. Take note of the immutable DCR ID as it is used to set up the audit writer.
    dcr list

Role assignment on the DCR for that service principal

Now, we need to give the application permission to use the DCR, so that our audit writer can send data to the new DCE and DCR.

  • From Monitor > Data Collection Rules, go to the new DCR page and select Access Control (IAM) > Add role assignment.
    role assignments
  • Select Monitoring Metrics Publisher > Next
    assignment metrics
  • Select User, group, or service principal for Assign access to, and select Select members. Add the application that we previously created.
    add members
  • Review and assign the application role.
    review and create the role

Configure Azure Log Analytics Audit Writer for use with DCR API

  • Configure the audit writer in Unify Connect and set Log Analytics Writer Type to DCR API.
  • Set theDCE logs ingestion URL found in the DCE overview page to Data Collection Endpoint.
  • Set the Immutable ID of the DCR to the Data Collection Rule ID.
  • Set the DCR stream name. This can be found in Azure portal on DCR page under Data Sources, then choose the data source name corresponding to the workspace table to be used for logging.
    data sources
  • Set the Auth Client ID, Auth Client Secret, and Auth Tenant ID found in the application registration overview page.

Microsoft reference