-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosmos trigger on Azure Functions v4 (.net 6) fails - cannot resolve SystemConfiguration.ConfigurationManager #750
Comments
Please see Azure/azure-cosmos-dotnet-v3#2798 (comment) this seems apparently some issue with System.Configuration on NET 6 but only when running on Functions (other users seem to have no issue outside of Functions). I don't know what is particular about Functions runtime though, probably something Functions team can chip in. |
Yep that's the same issue I think and it appears to be Functions specific. @cgillum is this likely to be a Functions issue? |
Seems likely to me to be Functions-specific. Adding @brettsam for awareness. |
Try using 4.0.0 of Microsoft.NET.Sdk.Functions -- that should fix it. https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/4.0.0 |
Thanks @brettsam . That did indeed, fix it! Onward to the release, then :-) |
Can you elaborate details regarding how this if this in 4.0.0? I have a similar issue here with C++/CLI enabled native-managed hybrid service, in which a user C# script (.csx) is executed inside a native entry service. Because GetEntryAssembly returns null, the SystemConfiguration.ConfigurationManager throws PlatformNotSupportedException. Same .csx worked under .NET Framework previously, however. I'd like to know how Azure Functions fixed this so I can apply the same fix to my case. |
System.Configuration.ConfigurationManager.dll needs to be somewhere that the app can load it. During the Functions build, we run a "cleanup" that deletes files that will already be present in Azure so you can save space in your deployment. We had a bug between the 4.0.0-preview and 4.0.0 of the Functions SDK where we'd not updated that list of files to delete, so it was deleting System.Configuration.ConfigurationManager.dll, even though it didn't exist in the Functions Azure deployment. This list of files to delete is maintained as an embedded resource in Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.dll. I don't understand your scenario, but the solution here was "make sure that file is deployed with the app".... |
I have a Cosmos trigger on Azure Functions v4 which cannot register the function because of a failure to resolve System.Configuration.ConfigurationManager version 4.0.3.0 (aka 4.7.0)
Repro steps
Create a function project - .net6 preview, functions v4 - with the following function:
local.settings.json is as follows:
Expected behavior
Function should run ...
Actual behavior
Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1'. Microsoft.Azure.WebJobs.Extensions.CosmosDB: Cannot create container information for RawData in database Stats with lease leases in database Stats : Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. Microsoft.Azure.Cosmos.Client: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Known workarounds
None yet
Microsoft.Azure.WebJobs.Extensions.CosmosDB - 4.0.0-preview2
Microsoft.Azure.Cosmos - 3.22.0
The text was updated successfully, but these errors were encountered: