The addition of ConfigurationManager 6.0 is a breaking change for Azure Function Apps 3
See original GitHub issueWe are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.
Describe the bug The dependency on System.Configuration.ConfigurationManager 6.0.0 introduced in the latest version of Azure.Cosmos (3.29.0) conflicts with the pinned version bundled with Azure Function App 3.
To Reproduce
- Create a new Azure Function App on version 3 of the SDK
- Install Azure.Cosmos 3.29.0
- Try to use the dependency in any manner, such as initializing a client
Expected behavior The expected behavior is for the exception not to be thrown.
Actual behavior An exception such as the following is thrown when using the library:
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.at Microsoft.Azure.Cosmos.DocumentClient.Initialize(Uri serviceEndpoint,ConnectionPolicy connectionPolicy,Nullable`1 desiredConsistencyLevel,HttpMessageHandler handler,ISessionContainer sessionContainer,Nullable`1 enableCpuMonitor,IStoreClientFactory storeClientFactory,TokenCredential tokenCredential)at Microsoft.Azure.Cosmos.DocumentClient..ctor
Environment summary SDK Version: 3.29.0 OS Version (e.g. Windows, Linux, MacOSX): MacOSX
Additional context Add any other context about the problem here (for example, complete stack traces or logs).
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Azure Functions runtime versions overview
The following articles detail breaking changes between versions, including language-specific breaking changes. They also provide you with step- ...
Read more >Migrate apps from Azure Functions version 3.x to 4.x
Review the list of breaking changes between 3.x and 4.x. Complete the steps in Upgrade your local project to migrate your local project...
Read more >Azure Functions – 2022 update
Azure Functions – 2022 update With Microsoft Build completed, and Ignite happening now, the team wanted to give an update on the latest ......
Read more >Develop C# class library functions using Azure Functions
Understand how to use C# to develop and publish code as class libraries that run in-process with the Azure Functions runtime.
Read more >Azure function app upgrade, function V4 ...
Function V4 runtime requires .NET 6.0. The platform didn't update it automatically, this is to avoid breaking customer's applications who uses ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ealsur Yes, this problem occurred only with Azure Functions V3. Azure Functions V4 worked fine because the offending
System.Configuration.ConfigurationManager
was not removed by the optimization process at publish time, but was left behind.This is due to the version 6.0.0 update of
System.Configuration.ConfigurationManager
package from Cosmos DB SDK v3.29 and the assembly optimization process in Azure Functions.You may need to add
_FunctionsSkipCleanOutput
orFunctionsPreservedDependencies
to csproj to resolve this.or