azure-functions-sql-extension: Failure to start SQL trigger on .NET 7

Due to project dependencies, I’m working with a function app that targets .NET 7 on an isolated process on Azure functions v4.

On Friday, I started using this package as I wanted to make use of the SQL Triggers functionality. I had it working with a table for an initial test but on Monday I made some changes to use a new table. Since that, I have been dealing with an issue that I can’t seem to figure out. So far the only fix I’ve found is switching to target .NET 6 (which requires commenting out a bunch of existing code in the project due to project dependencies). Unless I’m missing something I thought that .NET 7 is supported with this package, even though it targets .NET 6.

Here is the exception output:

Failed to start SQL trigger listener for table: ‘’, function ID: ‘’. Exception: System.TypeInitializationException: The type initializer for ‘Microsoft.Data.SqlClient.SqlAuthenticationProviderManager’ threw an exception. System.IO.FileNotFoundException: Could not load file or assembly ‘System.Threading, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. The system cannot find the file specified. File name: 'System.Threading, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’For detailed output, run func with --verbose flag. at System.Configuration.ConfigurationManager.EnsureConfigurationSystem() at System.Configuration.ConfigurationManager.PrepareConfigSystem() at System.Configuration.ConfigurationManager.GetSection(String sectionName) at Microsoft.Data.SqlClient.SqlAuthenticationProviderManager.FetchConfigurationSection[T](String name) at Microsoft.Data.SqlClient.SqlAuthenticationProviderManager…cctor() — End of inner exception stack trace — at Microsoft.Data.SqlClient.SqlInternalConnectionTds…ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen() — End of stack trace from previous location — at Microsoft.Azure.WebJobs.Extensions.Sql.SqlBindingUtilities.OpenAsyncWithSqlErrorHandling(SqlConnection connection, CancellationToken cancellationToken) at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken)

Apologies if the issue is something trivial on my end or not related to this repo. If so, any suggestions would be greatly appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

All works great with the latest.

Thank you!

@MaddyDev not sure that I’ll be able to test this soon so I’m happy for the issue to be closed if confident enough it has been fixed.

@maddydev I’ll give it a try today. Thanks.

Best regards, Keith Nicholson


From: Maddy @.> Sent: Tuesday, September 26, 2023 2:09:21 PM To: Azure/azure-functions-sql-extension @.> Cc: Keith Nicholson @.>; Mention @.> Subject: Re: [Azure/azure-functions-sql-extension] Failure to start SQL trigger on .NET 7 (Issue #920)

@Stxticshttps://github.com/Stxtics, @keithnicholsonhttps://github.com/keithnicholson We have released a new package addressing the issue that’s affecting .NET 7. This should be resolved, can you confirm if you’re able to run a SQL trigger successfully. Thanks.

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-functions-sql-extension/issues/920#issuecomment-1736135409, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AARACMBXNTHFEFHWCFY4WODX4MR6DANCNFSM6AAAAAA4UW4ALA. You are receiving this because you were mentioned.Message ID: @.***>

@MaddyDev I haven’t been able to run a trigger on .NET 7 with the 3.0.341-preview package since last week I believe if that’s any help. (Same error as first post)

@Stxtics Thank you, just double checking again: you were able to successfully run a SQL trigger binding function with .NET 7 before? Or is it an input/output binding?

@MaddyDev Yes the SQL trigger functionality. I believe it worked on Friday for an initial test. then on Monday I couldn’t get it to work.

We are working on getting a version of the extension out that rolls back the change which broke this to immediately unblock people, and then as Maddy said we will be working to find a long term fix that won’t break .NET 7 as well for GA.