Azure / azure-functions-extension-bundles

Azure Functions Extension Bundles
MIT License
70 stars 52 forks source link

CosmosDB output binding error in Extension Bundles 4.3.1 Preview #211

Open lai19190 opened 1 year ago

lai19190 commented 1 year ago

Description

When executing a function with CosmosDB output binding, it failed with the following error message Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. It works fine in the previous Extension Bundles 4.2.1 Preview

App Details

ArunasFalcon commented 1 year ago

I have this problem too. It's not just the output binding, the trigger also doesn't work. Cosmos DB, Azure Function running with a user assigned managed identity triggering on the Cosmos DB, logs show the following error messages:

Error indexing method 'Functions.CosmosTrigger1' ---> System.InvalidOperationException : Cannot create container information for channela in database outchannels with lease channelaleases in database outchannels : Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. ---> System.IO.FileNotFoundException : Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

As @lai19190 commented, switching back to the previous extension bundle fixes the problem. I have a working demo set up in my Azure account and can give access in case someone wishes to investigate.

Edit: Azure function using Powershell 7.2

mgarf commented 1 year ago

Seeing the same on the input side as well

Exception while executing function: Functions.fetcher <--- Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

shibayan commented 1 year ago

I encountered the same problem. The cause is that version 6.0 of System.Configuration.ConfigurationManager.dll is not shipped with Azure Functions Host, while Bundle Extensions expect version 6.0 to be shipped with Azure Functions Host.

It may be related to the following Issue.