Hello everybody,
I am in the middle of building a solution using SharePoint, Azure Logic Apps and Azure Automation PowerShell runbooks.
I have the following scenario:
We have this ERP kind-off system that allows my (B2C) customer (kitchen company) to register quotes, orders, and invoices. For document management reasons they wanted to use SharePoint Online.
For each customer they have, they want to have a SharePoint team site that allows them to store and tag (managed metadata) documents and pictures, and take notes.
They have more than 7.000 unique (B2C) customers. And because one of their registered customers can walk in anytime, they want to have a team site for all of the accounts registered within the system. That’s why the amount of 7.000+.
I have built a Logic App workflow that automatically creates a new team site if a CSV file contains a new customer, and additionally it will create document sets for each kitchen project. That is not done by hand, so from within the Logic App workflow I am running a Azure Automation PowerShell runbook containing PnP-PowerShell cmdlets to fully provision the site, think about:
- Enabling site and site collection features
- Adding libraries and navigation items
- Adding site columns and content types
- Adding the content types to the lists
- Configuring permissions
- Etc.
As you may notice this takes a little while. Actually all this works perfectly!
Now the real question.
Every hour I want to import a new CSV file that contains new invoices and orders, across all accounts in the system. And I would like to include ‘throttling prevention’ mechanisms but I really need some help with that because it is my first time dealing with such a large amount of team sites and data to be processed. I am hoping to find a jumpstart here.
Could anyone please help me provide some guidance how to apply throttling mechanisms? Especially for my PnP PowerShell script. As I could not really find PnP code examples and I have no clue how to start there.
The desired outcome is that the PnP PowerShell runbook manages the retries by itself, and Logic Apps as well.
Maybe I should start with the Logic app trigger concurrency? https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-actions-triggers#change-trigger-concurrency
But if I would let 5 jobs run concurrently, it could still hit the throttling limit, so I guess I need to apply some measures inside my PnP script as well.
I hope this is clear enough, if not I will be happy to elaborate.
Thanks a lot for all help provided, I really appreciate all the efforts!
Kind regards,
Joost