I have enabled SQL Server audit on one of the cloud SQL Instance.
The audit is enabled and files are being uploaded to respective bucket.
When I’m trying to query the Audit with provided query in Google Cloud document i.e.
SELECT event_time, statement FROM msdb.dbo.gcloudsql_fn_get_audit_file(‘/var/opt/mssql/audit/*’, NULL, NULL) WHERE statement LIKE ‘%INSERT%’
I’m getting below error. I’m using SQL Server authentication with CustomDBRootRole.
The SELECT permission was denied on the object ‘gcloudsql_fn_get_audit_file’, database ‘msdb’, schema ‘dbo’.
In the documentation there is nothing mentioned regarding any specific permission for this function.