Forum Discussion

Bernd Verhofstadt's avatar
Bernd Verhofstadt
Iron Contributor
Feb 12, 2018

Azure Function and SharePoint PnP PowerShell are mixing up the client context

Hi,

I'm experimenting with Azure Function, Logic apps/Flow to replace an existing SharePoint Workflow.

I've found a weird issue where the client context get mixed up when multiple flows are running in parallel and try to call the azure function. I've found a workaround to overcome this issue by allowing only one job on the azure function environment. It's not a good solution, therefor I want to find the root cause of the following error message :

Exception calling "Load" with "1" argument(s): "The object is used in the context different from the one associated with the object."

Has someone encounter a similar issue?

 

Cheers 

Bernd

 

 

3 Replies

  • Same issue:
    https://social.msdn.microsoft.com/Forums/azure/en-US/28bff860-e990-4b89-bf67-e6af4efef442/pnp-powershell-in-azure-function-fails-when-to-fast-triggerd-in-a-time-intervall?forum=AzureFunctions
    • Warwick Ward's avatar
      Warwick Ward
      Bronze Contributor
      This is interesting, do you know if it's still the case now days?
      • Miroslav675's avatar
        Miroslav675
        Copper Contributor

        I'm still having the same issue...
        My use case is with getting properties of a SharePoint Online item that was just created with Copy-PnPFile

Resources