Diagnostics Settings to direct Audit Logs to Event Hub for APIM instance using Bicep

Taranjeet Malik 546 Reputation points
2024-07-30T04:35:08.0533333+00:00

Hi

I would like to configure the diagnostic settings for a newly deployed APIM instance using Bicep.

Have referred to the guidance here--> https://video2.skills-academy.com/en-us/azure/azure-resource-manager/bicep/scenarios-monitoring

When I'm deploying the following code as part of the APIM module

resource apimdiaglogs 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {

  name: apim.name

  scope: apim

  properties: {

    eventHubName: 'evname'

    eventHubAuthorizationRuleId: eventhubauthruleid

    logs: [

      {

        enabled: true

        category: 'AuditLogs'

      }

    ]

  }

}

I've also used categoryGroup and no matter what the value I set that for, the error remains the same.

However, I'm getting the following error:

Category 'audit' is not supported. (Code: BadRequest, Target:)

I'm allowed to do this through Azure Portal.

Can someone provide inputs on where I'm possibly going wrong?

Thanks

Taranjeet Singh

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,196 questions
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,074 questions
{count} votes

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.