I'm trying to run my azure function application as a docker image and when I do it throws me a System.PlatformNotSupportedException in Microsoft.Data.SqlClient.dll: 'Strings.PlatformNotSupported_DataSqlClient'
exception any time I try to call my datalayer (no matter if its EF Core or Dapper that I use). I can run the application just fine when setting my API project as startup instead of the docker image.
There are very similar questions out there but none of them take into account that it is ONLY happening when I try to run it as a docker image or the fact that my target framework is netcoreapp3.1
. I've already tried what the similar questions said. which is to add System.Data.SqlClient
as a Nuget package which doesn't help no matter what version I make it.
I suspect I need to add something to the Dockerfile
or something.
here is some additional information:
EDIT: I am able to recreate the issue in a new project by simply creating an azure function, adding docker support, creating a simple data layer that performs a CRUD operation on a local database, then running the docker image and calling the endpoint that does the CRUD operation. Hope that helps.