-
Hi I was wondering if you had any resources you could point to which outline best practices and configurations for using the PnP Provisioning engine with Azure Function Apps? I have came across a problem where depending on the complexity of the provisioning template being applied it can take up to 10 minutes. There is a built in time out for Azure Functions of 230 seconds if the function has not returned any data. (There are many posts that cover this including Azure/Azure-Functions#1053 ). This timeout is different than the Azure Function timeout limit and can not be changed or avoided. When using the inbuilt Azure function test tools in the browser you will see the function being run a second time while the first thread is still running. If you use Postman, you will get a 500 error but checking the Azure function logs you see that the function itself is still executing. Are there any recommendations around using Azure Durable Functions or Storage queues to avoid this timeout? Also, are there any configuration best practices for the Azure Function App itself for concurrency or performance? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@Nibushi , The easiest solution is running your function in a Premium or App Service plan, see https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale?WT.mc_id=AZ-MVP-4021705 for more details. This blog from Tobias Zimmergren provides some good advice as well: https://zimmergren.net/best-practices-for-building-and-designing-azure-functions/ |
Beta Was this translation helpful? Give feedback.
-
Hi @jansenbe , I'm only starting out with Azure Function so I might be wrong, but the Premium or App service plan wouldn't help in this situation as the 230 second time out still applies if no data is being sent back and forth. The Azure Function will still continue to run in the background however the client calling the Azure Function will receive an error message saying that the Function has timed out. I am aware that there is a timeout of the functions in the consumption model of 5 minutes which can be extended to 10 minutes which I have already done. As I say this 230 second timeout is different from that and is related to the Azure Function not returning a status code within that time, which happens when applying a large provisioning template. I've been looking into Durable Functions a lot of examples are in C#. I am open to using C# instead of PowerShell as I was a developer in the past. However, it's been a while and a lot of the examples I have found seem to require some implied knowledge. Do you know if the are performance benefits in using C# over PowerShell in an Azure Function? I am hoping that some others might read this post and explain how they handle applying long running templates using Azure Functions. |
Beta Was this translation helpful? Give feedback.
-
Durable functions can handle this. I'm going to transfer this one to the GitHub discussions as this is not really an issue |
Beta Was this translation helpful? Give feedback.
Durable functions can handle this. I'm going to transfer this one to the GitHub discussions as this is not really an issue