Azure-functions-vs-build-sdk: Microsoft.Data.SqlClient is not supported on this platform with Microsoft.NET.Sdk.Functions 3.0.8

Created on 3 Jul 2020  路  11Comments  路  Source: Azure/azure-functions-vs-build-sdk

Hi,

After upgrading this package to the latest version my data access calls start to fail with the message "Microsoft.Data.SqlClient is not supported on this platform."

This is with nuget packages Microsoft.NET.Sdk.Functions 3.0.8 and Microsoft.Data.SqlClient 1.1.3
Project Type is a .Net Core 3.1 Azure Function

If I downgrade back to version 3.0.7 everything works again.

Let me know if you need any further information.

Regards,
Christian

P1

Most helpful comment

Hey its not like anyone uses SQL Server in their functions.

All 11 comments

I am getting the exact same issue. However, the data project which the functions project references has EF Core dependency and so the functions project has no direct reference to the Microsoft.Data.SqlClient package.

Azure Functions Core Tools: 3.0.2630
Function Runtime Version: 3.0.13901.0

I have noticed that the bin\Debug\netcoreapp3.1\bin folder no longer has a runtimes folder included. It is in the \bin directory as a sibling of the \bin folder and not as a child. If I manually move the \bin\Debug\netcoreapp3.1\runtimes folder into a \bin\Debug\netcoreapp3.1\bin\runtimes folder then the error no longer occurs...

The issue appears to be something similar to this issue here: https://github.com/Azure/azure-functions-vs-build-sdk/issues/333

I am having the same issue. Here are the reproduction steps

  • OS: Mac Catalina 10.15.5
    apple_spec

  • func cli version
    func_cli

  • csproj file
    csproj

  • Azure Function
    hello_function

  • Exception when calling Azure function endpoint
    500_error

Looks like there is a new release of Azure functions host -> 3.0.14063 that may have the fix for SQL nuget
function_host_releases

When can we expect new release from azure-functions-core-tools with Azure functions host 3.0.14063 ?

What a lovely surprise... this only you only blew up sqlclient... that is a step in the right direction. But really... Come on guys you are better than this.

I am getting the exact same issue!
I needed to rollback to 3.0.7 to work again

Adding @brettsam since you found this issue before the release rolled out to PROD.

For some context - SqlClient was a dependency of one of our other dependencies and with a version update, we lost that. It's generally not recommended to rely on our implicit references but we definitely know that it's bad to break people in this way (sorry!). Brett please correct me anywhere :)

Yeah that host didn't even roll out, so this is completely unrelated to any host changes. Something in the build steps broke. I believe something in how we copy assemblies to the output directory.

@vijayrkn -- can you take a look at this and see what could have broken in this release? And please create a release and a tag so we can see the changes that went into 3.0.8.

Right now those changes are here -- https://github.com/Azure/azure-functions-vs-build-sdk/compare/3.0.7..v3.x

I think it might be related to this change - https://github.com/Azure/azure-functions-vs-build-sdk/compare/3.0.7..v3.x#diff-d8bcef347a6d5235a4c5ebe81e10ae79L14

@soninaren - Can you please hold off on updating all templates with 3.0.8 until this issue is resolved? will try to get the fix in today.

Hey its not like anyone uses SQL Server in their functions.

It didn't take up too much of my time. I went back pretty fast. I would have yanked 3.0.8 though.

Was this page helpful?
0 / 5 - 0 ratings