Azure / Azure/azure-functions-host

Function Monitor Logs tab not showing any error logs

Open
#9,239 1 comment 0 reactions 0 assignees View on GitHub
bug Logging and Metrics
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

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:

1. Create a function with a SQL Trigger
2. Deploy function
3. 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)`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the SQL Trigger failure and compare the function's Monitor Logs tab with App Insights and the function app's Log Stream. Trace how the Monitor Logs tab handles trigger errors, using the supplied timestamp, function name, and error message. Done means the error appears in Monitor Logs while the trigger is failing, with execution logs still visible after the permission issue is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, sql
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.