Data Collection Rule ARM template fails when using a custom table

Scoot-3223 91 Reputation points
2023-08-15T18:28:51.47+00:00

Looking for help resolving an issue with this tutorial: Send data to Azure Monitor using Logs ingestion API, via ARM. The Portal version of the tutorial works fine but the ARM version fails when deploying the ARM template for the Data Collection Rule.

Analysis reveals the Output Stream of the DCR must start with the word Custom- or an exception is thrown. So the DCR template is good, but, the custom table that's created via the CLI in the ARM tutorial cannot have the Custom- prefix, as table names cannot have special characters.

So I cannot find a way to create a custom table that's acceptable for the Data Collection Rule.

This works fine in the Portal as when the Data Collection Rule is created, the table is created automatically behind the scenes.

I appreciate any help!

ARM deployment error when using the specified template.

error": {
        "code": "InvalidPayload",
        "message": "Data collection rule is invalid",
        "details": [
            {
                "code": "InvalidOutputTable",
                "target": "properties.dataFlows[0]",
                "message": "Table for output stream 'Custom-MyTable_CL' is not available for destination 'myworkspace'."
            }
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Scoot-3223 91 Reputation points
    2023-08-24T21:15:32.3733333+00:00

    Posted my answer in the most recent comment above. Hopefully this can be of some use.

    0 comments No comments

  2. SwathiDhanwada-MSFT 18,996 Reputation points Moderator
    2023-08-25T04:27:13.7166667+00:00

    @Scoot-3223 Thanks for sharing your solution here. It would be beneficial to the customers who are facing similar issue.

    As per community rules, one can't accept their own answer. So, summarizing the answer provided by you in answer section for community benefit.

    The resolution to customer issue involved understanding the process of manually generating the custom table. The custom table cannot be generated through the portal, as it enforces the creation within Log Analytics, simultaneously generating the Data Collection Rule (DCR). Creating the table through the azapi provider resource proves to be effective. Subsequently, the arm template can be utilized to produce the DCR. In summary, customer has fully automated the endpoint, custom table, and data collection rule creation using Terraform. Consequently, they have achieved a functional app that writes real-time logs to the custom table.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.