1

I have my .dll project which contains an Entity Framework database connection.

Now I am trying to use reference of this DLL in Azure function, without any success yet.

DLL throws an exception while creating my context object.

I have install Entity Framework in Azure function This is my package.json-

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "EntityFramework": "6.1.3"
      }
    }
  }
}

I followed some posts and came to know that we need to create partial class Azure function inheriting from DBContext which was auto generated in DLL project, so I added that as well.

A have added connection string in Azure Application settings as below and also changed connection string type from SQLServer to Custom -

metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string='data source=*****;initial catalog=*****;persist security info=True;user id=<user_id>;password=<password>;MultipleActiveResultSets=True;App=EntityFramework' providerName="System.Data.EntityClient"

Previously I was getting metadata keyword is not supported error and I fixed that somehow.

Now I am getting providerName attribute not found error on Azure function.

Any help will be appreciated.

SharadG
  • 165
  • 3
  • 10
  • See: https://stackoverflow.com/questions/46698103/missing-providername-when-debugging-azurefunction-as-well-as-deploying-azure-fun/46706044#46706044 – Juan Gelos Apr 09 '18 at 17:04
  • If someone is still looking for answer, I couldn't find any direct option to use EF in Azure. So I had to override the class auto created by EF which accepts connection string as a input. – SharadG Jan 18 '19 at 12:28

0 Answers0