How to Fix Flex Consumption Plan Permission Errors

I ran into a permission error when moving Azure Functions to the Flex Consumption plan.
At the time I was deploying with the Azure CLI; it told me an authorization issue existed but never revealed which permission was missing, so I spent a while poking around.
Once I switched the Azure Pipelines task from AzureCLI@2 to AzureFunctionApp@2, the failure message finally pointed out the exact permission that needed to be granted.
The culprit was the Microsoft.Web/sites/publishxml/action permission. Granting it cleared the error and the deployment succeeded.
Hope this helps somebody else.




