Skip to content

Data Connection Rule / Endpoint and Log Analytics DCR-driven table for structured logging #1171

@Ryan-Palmer

Description

@Ryan-Palmer

I have just set up structured logging in Log Analytics using Serilog's most recent plugin.

As part of that, you have to follow a guide showing you how to use the Log Ingestion API.

The steps are roughly

  1. Create a Data Collection Rule (DCR) driven table in your log analytics workspace.
  2. Create and assign it a DCR, which itself references to a Data Collection Endpoint (DCE).
  3. Both the table and the DCR need an example of the JSON blob which will be sent, and the DCR needs to specify which column is the timestamp.
  4. The DCR needs to assign the Monitoring Metrics Publisher role to the identity used to push logs. The guide shows using an EntraId app but it actually supports System Identity now.
  5. The app needs to load the DCE endpoint and DCR immutable id / stream name into config for the Serilog plugin to use.

I had to do all of these steps in the portal as I couldn't find Farmer support for them, although I may have missed it.

There is a guide to deploying with ARM.

I think we would need the abilities to

  • Create a DCR, which can automatically create its DCE if using ARM to deploy.
  • Add a DCR driven table in the LogAnalytics builder, referencing the DCR resource.
  • Supply the JSON template strings to the DCR Data Source and Log Analytics table schema, and the Timestamp field name to the DCR for the Transformation mapping
  • Assign the MonitoringMetricPublisher role to the web app's SystemIdentity in the DCR builder
  • Pluck out the DCR / DCE app settings we need and load them into the web app.

This is another one I am happy to pick up and have a go at if it sounds like I am on the right track? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions