title: How to fix 'Operation is not valid due to the current state of the object' error in .Net Azure Function App?
body: <p>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:</p>
  
  <blockquote>
    <p>Operation is not valid due to the current state of the object</p>
  </blockquote>
  
  <p>According to multiple threads on the Stack Overflow (i.e. <a href="https://stackoverflow.com/questions/8832470/operation-is-not-valid-due-to-the-current-state-of-the-object-error-during-pos">&#39;Operation is not valid due to the current state of the object&#39; error during postback</a> ), to resolve the problem the web config file should be configured in the following way: </p>
  
  <pre><code>&lt;appSettings&gt;
       &lt;add key="aspnet:MaxHttpCollectionKeys" value="2001" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>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?</p>