Error logs from SQL Trigger are not showing up in the function Monitor Logs tab. The function's Monitor Logs tab is empty even though I can see the logs in App Insights and in the function app's Log Stream.
Investigative information
Please provide the following:
Timestamp: 2023-04-27T15:53:51Z
Function App version: 4
Function App name: luczhanCSharpApp
Function name(s) (as appropriate): ProductsTrigger
Invocation ID:
Region: East US
Repro steps
Provide the steps required to reproduce the problem:
Create a function with a SQL Trigger
Deploy function
Navigate to the function's Monitor Logs tab
Expected behavior
Errors show up in the Monitor Logs tab
Actual behavior
Monitor Logs tab is empty
Known workarounds
When I navigate to my function app's Log Stream, I can see the errors:
2023-04-27T15:53:51Z [Error] Failed to check for changes in table 'dbo.Products' due to exception: Microsoft.Data.SqlClient.SqlException. Exception message: The VIEW CHANGE TRACKING permission was denied on the object 'Products', database 'test', schema 'dbo'.
Once I fix the issue and go back to the Monitor Logs tab, I can see execution logs:
2023-04-27T16:10:02Z [Information] Executing 'ProductsTrigger' (Reason='New change detected on table '[dbo].[Products]' at 2023-04-27T16:10:02.1196180Z.', Id=f0e4d388-6b56-4f53-aa44-9a3cb31d1a7f) 2023-04-27T16:10:02Z [Information] SQL Changes: [{"Operation":1,"Item":{"ProductId":91,"Name":"new name2345","Cost":3}}] 2023-04-27T16:10:02Z [Information] Executed 'ProductsTrigger' (Succeeded, Id=f0e4d388-6b56-4f53-aa44-9a3cb31d1a7f, Duration=0ms)
Error logs from SQL Trigger are not showing up in the function Monitor Logs tab. The function's Monitor Logs tab is empty even though I can see the logs in App Insights and in the function app's Log Stream.
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
Expected behavior
Errors show up in the Monitor Logs tab
Actual behavior
Monitor Logs tab is empty
Known workarounds
When I navigate to my function app's Log Stream, I can see the errors:
2023-04-27T15:53:51Z [Error] Failed to check for changes in table 'dbo.Products' due to exception: Microsoft.Data.SqlClient.SqlException. Exception message: The VIEW CHANGE TRACKING permission was denied on the object 'Products', database 'test', schema 'dbo'.
Once I fix the issue and go back to the Monitor Logs tab, I can see execution logs:
2023-04-27T16:10:02Z [Information] Executing 'ProductsTrigger' (Reason='New change detected on table '[dbo].[Products]' at 2023-04-27T16:10:02.1196180Z.', Id=f0e4d388-6b56-4f53-aa44-9a3cb31d1a7f) 2023-04-27T16:10:02Z [Information] SQL Changes: [{"Operation":1,"Item":{"ProductId":91,"Name":"new name2345","Cost":3}}] 2023-04-27T16:10:02Z [Information] Executed 'ProductsTrigger' (Succeeded, Id=f0e4d388-6b56-4f53-aa44-9a3cb31d1a7f, Duration=0ms)