0

We are developing a set of Azure functions for our new product. We are using dependency injection for our project following the strategy , mentioned in the following article

https://blog.wille-zone.de/post/azure-functions-dependency-injection/

and registered the extension in Startup.cs

This is working fine in the local development environment. However when we tried to publish it azure , the azure functions runtime was not detecting the injected dependencies . We found a similiar problem in the following sctak over flow.com post

IExtensionConfigProvider not initializing or binding with Microsoft.Azure.WebJobs v3

We made changes as per their recommendation in the accepted answer. As per this

"In C# the SDK 1.0.19 looks at build time for classes attributed with WebJobsStartup assembly attribute in the current function project or any dependency (ProjectReference or PackageReference) of the current project, and generates the corresponding extensions.json file."

However we ran in to strange problem, When we do a release build , the startup class entry is created in the extensions.json

{ "extensions":[ { "name": "AzureStorage", "typeName":"Microsoft.Azure.WebJobs.Extensions.Storage.AzureStorageWebJobsStartup, Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}, { "name": "Startup", "typeName":"AAA.BBBB.Functions.Startup, AAA.BBB.Functions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} ] }

however when we try to publish , the startup class entry is NOT created in the extensions.json

{ "extensions":[ { "name": "AzureStorage", "typeName":"Microsoft.Azure.WebJobs.Extensions.Storage.AzureStorageWebJobsStartup, Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"} ] }

We are stumped and do not know what is the problem

Sabarish Sathasivan
  • 1,196
  • 2
  • 19
  • 42

1 Answers1

0

Looks this this is a known issue. Refer the Github URL for more details -

https://github.com/Azure/Azure-Functions/issues/972#issuecomment-426708865

Currently proceeded in the workaround approach

Sabarish Sathasivan
  • 1,196
  • 2
  • 19
  • 42