Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 441 forks source link

Failed to start SQL trigger - Microsoft.Data.SqlClient is not supported on this platform. #9709

Open charliecheng23 opened 11 months ago

charliecheng23 commented 11 months ago

Steps to Reproduce:

  1. Run func start
  2. Below error to listener to sql trigger -

Failed to start SQL trigger listener for table: 'dbo.STG_WATER_GW_DIVERSION_AUTHORIZATION', function ID: '5c477fd9feb82cd5'. Exception: System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platform. [2023-11-29T04:06:51.544Z] at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) [2023-11-29T04:06:51.547Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken) [2023-11-29T04:06:51.549Z] The listener for function 'Functions.appchangescdegwauth' was unable to start. [2023-11-29T04:06:51.551Z] The listener for function 'Functions.appchangescdegwauth' was unable to start. Microsoft.Data.SqlClient: Microsoft.Data.SqlClient is not supported on this platform.

lucyzhang929 commented 11 months ago

@charliecheng23 This issue seems similar to https://github.com/Azure/Azure-Functions/issues/1370. I will transfer to the Azure Functions host repository for further investigation.

bhagyshricompany commented 11 months ago

pls share all steps .Thanks

charliecheng23 commented 11 months ago

@bhagyshricompany : I run sql trigger python function in vs code - func start
Failed to start SQL trigger listener for table: 'dbo.STG_WATER_GW_DIVERSION_AUTHORIZATION', function ID: '5c477fd9feb82cd5'. Exception: System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platform. [2023-11-29T04:06:51.544Z] at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) [2023-11-29T04:06:51.547Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken

I have installed mutliple dot net version on my computer, not sure how vs code of azure python function is looking for Microsoft.Data.SqlClient.SqlConnection?

bhagyshricompany commented 11 months ago

pls share function name ,invocation id ,region.

charliecheng23 commented 11 months ago

@bhagyshricompany : The issue is when I am running the function on my development window 10 Enterprise for Virtual Desktop..

.NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.8d38d0cc

Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed: Workload version: 8.0.100-manifests.8d38d0cc There are no installed workloads to display.

Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71

.NET SDKs installed: 8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

bhagyshricompany commented 11 months ago

@brettsam pls confirm and validate.