Diagnostics Settings to direct Audit Logs to Event Hub for APIM instance using Bicep
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