Azure-Samples / Azure-Samples/functions-quickstart-dotnet-azd-sql

Error related to Table Creation : Could not find table: 'dbo.ToDo'.

オープン
#13 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Bicep
スター
1
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

説明

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)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ログに記載されている SQL トリガーリスナーのエントリポイント、SqlTriggerUtils.GetUserTableIdAsync と SqlTriggerListener.StartAsync から始めます。デプロイされた関数のデータベース構成を、オンラインクエリエディターと VS Code mssql 拡張機能を使用して調査したデータベースと比較し、dbo.ToDo が存在しない理由に焦点を当てます。SQL トリガーがテーブル不足エラーなしで開始し、対象のデータベースにテーブルが存在すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, csharp, sql
領域
backend, cloud, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。