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

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

Ouverte
#13 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Bicep
Étoiles
1
Forks
6
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par les points d’entrée du listener du trigger SQL nommés dans les logs : SqlTriggerUtils.GetUserTableIdAsync et SqlTriggerListener.StartAsync. Comparez la configuration de base de données de la fonction déployée avec la base de données inspectée à l’aide de l’éditeur de requêtes en ligne et de l’extension mssql de VS Code, en vous concentrant sur la raison pour laquelle dbo.ToDo est absente. Le travail est terminé lorsque le trigger SQL démarre sans l’erreur de table manquante et que la table est présente dans la base de données prévue.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
azure, csharp, sql
Domaine
backend, cloud, databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.