I have a .NET Azure Function executed by Logic Apps triggered by an SQL connector "When an item is created V2". The function gathers data from multiple APIs and inserts the data into a SQL DB. The function works good for singular records, however, when a batch of records is inserted into the SQL table triggering the function, then the function breaks with the following error:
Operation is not valid due to the current state of the object
According to multiple threads on the Stack Overflow (i.e. 'Operation is not valid due to the current state of the object' error during postback ), to resolve the problem the web config file should be configured in the following way:
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="2001" />
</appSettings>
Is there any way to change the web.config file of an Azure Function App? Where I will find it? Or should I create it by myself? Do you have any other ideas on how to resolve the issue?
You can set it with the properties of "maxOutstandingRequests" and "maxConcurrentRequests" in the host.json in your azure function(go to your function app --> Overview --> Function app settings --> host.json), please refer to this tutorial
Hope it would be helpful to your problem.