An Azure managed MySQL database service for app development and deployment.
Hello @Zafar Shaikh
What you're seeing appears to be expected behavior for Azure Database for MySQL Flexible Server at present, rather than an issue with your CLI syntax or API version.
Although the diagnostic setting accepts logAnalyticsDestinationType = Dedicated and subsequently reports the destination as Dedicated, Microsoft's current supported-logs documentation maps both MySqlAuditLogs and MySqlSlowLogs for Microsoft.DBforMySQL/flexibleServers to AzureDiagnostics, not to resource-specific tables.
Microsoft's MySQL Flexible Server monitoring documentation reinforces this. It lists the relevant Log Analytics tables as AzureActivity, AzureDiagnostics, and AzureMetrics, and its examples for both audit and slow-query logs query AzureDiagnostics.
In your situation, changing the API version, region, MySQL version, or recreating the diagnostic setting will not cause MySqlAuditLogs or MySqlSlowLogs to be stored in dedicated tables. Although the diagnostic-setting control plane supports the Dedicated destination type, the resource provider's category-to-table mapping ultimately determines where those logs are ingested.
Your working query is therefore currently the appropriate one:
AzureDiagnostics
| where Category == "MySqlAuditLogs"
| where _ResourceId contains "db"
| where TimeGenerated > ago(1h)
Interestingly, there is documentation for tables named MySqlAuditLogs, which makes this confusing. However, the authoritative supported-log mapping for Microsoft.DBforMySQL/flexibleServers currently maps these categories to AzureDiagnostics. Microsoft's newer platform-logs reference also explicitly maps MySQL Flexible Server MySqlAuditLogs and MySqlSlowLogs to AzureDiagnostics.
So treat the behavior you're seeing as a current service limitation/documentation inconsistency, not a configuration problem.
I also couldn't find a published Microsoft roadmap or GA date for moving these Flexible Server categories to resource-specific Log Analytics tables. If dedicated tables are a requirement for your logging architecture, I'd recommend opening an Azure support request and asking Microsoft to confirm the roadmap for resource-specific mode for Microsoft.DBforMySQL/flexibleServers.
References:
Monitoring data reference for Azure Database for MySQL Flexible Server
Monitor Azure Database for MySQL Flexible Server
Hope this clarifies why Dedicated is shown in the diagnostic setting while the actual records continue to land in AzureDiagnostics.
=============================================================================
Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution.