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

Taranjeet Malik 496 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://learn.microsoft.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,049 questions
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,964 questions
0 comments No comments
{count} votes