Azure-Samples / Azure-Samples/functions-quickstart-dotnet-azd-sql
Error related to Table Creation : Could not find table: 'dbo.ToDo'.
- Vorherrschende Sprache
- Bicep
- Sterne
- 1
- Forks
- 6
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Provisioning and deployment happens just fine. I can see in the logs that the function is getting triggered. However, I noticed no table exists in the database when I checked it using the online query editor, and then, using the mssql extension on VS Code.
When I run the code locally, I get a more specific error.
```
[2025-11-26T15:32:47.647Z] Host lock lease acquired by instance ID '000000000000000000000000928942B5'.
[2025-11-26T15:32:49.098Z] Failed to start SQL trigger listener for table: 'dbo.ToDo', function ID: '5a30d5d2d2bc604e'. Exception: System.InvalidOperationException: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:32:49.103Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerUtils.GetUserTableIdAsync(SqlConnection connection, SqlObject userTable, ILogger logger, CancellationToken cancellationToken)
[2025-11-26T15:32:49.106Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken)
[2025-11-26T15:32:49.132Z] The listener for function 'Functions.sql_trigger_todo' was unable to start.
[2025-11-26T15:32:49.136Z] The listener for function 'Functions.sql_trigger_todo' was unable to start. Microsoft.Azure.WebJobs.Extensions.Sql: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:32:51.398Z] Failed to start SQL trigger listener for table: 'dbo.ToDo', function ID: '5a30d5d2d2bc604e'. Exception: System.InvalidOperationException: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:32:51.402Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerUtils.GetUserTableIdAsync(SqlConnection connection, SqlObject userTable, ILogger logger, CancellationToken cancellationToken)
[2025-11-26T15:32:51.408Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken)
[2025-11-26T15:32:51.414Z] The listener for function 'Functions.sql_trigger_todo' was unable to start.
[2025-11-26T15:32:51.419Z] The listener for function 'Functions.sql_trigger_todo' was unable to start. Microsoft.Azure.WebJobs.Extensions.Sql: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:32:56.041Z] Failed to start SQL trigger listener for table: 'dbo.ToDo', function ID: '5a30d5d2d2bc604e'. Exception: System.InvalidOperationException: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:32:56.047Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerUtils.GetUserTableIdAsync(SqlConnection connection, SqlObject userTable, ILogger logger, CancellationToken cancellationToken)
[2025-11-26T15:32:56.049Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken)
[2025-11-26T15:32:56.053Z] The listener for function 'Functions.sql_trigger_todo' was unable to start.
[2025-11-26T15:32:56.055Z] The listener for function 'Functions.sql_trigger_todo' was unable to start. Microsoft.Azure.WebJobs.Extensions.Sql: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:33:01.947Z] Failed to start SQL trigger listener for table: 'dbo.ToDo', function ID: '5a30d5d2d2bc604e'. Exception: System.InvalidOperationException: Could not find table: 'dbo.ToDo'.
[2025-11-26T15:33:01.949Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerUtils.GetUserTableIdAsync(SqlConnection connection, SqlObject userTable, ILogger logger, CancellationToken cancellationToken)
[2025-11-26T15:33:01.953Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken)
[2025-11-26T15:33:01.955Z] The listener for function 'Functions.sql_trigger_todo' was unable to start.
[2025-11-26T15:33:01.959Z] The listener for function 'Functions.sql_trigger_todo' was unable to start. Microsoft.Azure.WebJobs.Extensions.Sql: Could not find table: 'dbo.ToDo'.
```
The deployed function seems to running fine and does not show any error in the Application Insights. It does not complain about any missing tables and such.
Please advice.
Jay (Vijayasimha BR)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginnen Sie mit den in den Logs genannten Einstiegspunkten des SQL-Trigger-Listeners: SqlTriggerUtils.GetUserTableIdAsync und SqlTriggerListener.StartAsync. Vergleichen Sie die Datenbankkonfiguration der bereitgestellten Funktion mit der Datenbank, die über den Online-Abfrageeditor und die VS Code mssql-Erweiterung untersucht wurde, und konzentrieren Sie sich darauf, warum dbo.ToDo fehlt. Als abgeschlossen gilt die Aufgabe, wenn der SQL-Trigger ohne den Fehler wegen der fehlenden Tabelle startet und die Tabelle in der vorgesehenen Datenbank vorhanden ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- azure, csharp, sql
- Bereich
- backend, cloud, databases
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 30/100