Hello David,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Problem
I understand that you are having an issue when deploying a flex function app with VNet integration
Solution
The error message you received, "InternalServerError," can be quite complex to troubleshoot. But, based on the information you've provided, there are four things I would like us to check and the links provided will guide you in more detail steps:
- Service Endpoint for Storage. To ensure that your Function App subnet has a service endpoint for Microsoft.Storage, you can add the "Microsoft.Storage" service endpoint to your Function App subnet. Navigate to your Virtual Network resource, go to "Settings," and select "Service endpoints" to configure this: https://www.reddit.com/r/AZURE/comments/1dkliw5/unable_to_deploy_flex_function_app_with_vnet/
- Let's check your Subnet Delegation, the subnet used for VNet integration cannot already be in use for other purposes (e.g., private or service endpoints) or delegated to any other hosting plan or service and in your Bicep file, make sure you're delegating the correct service for Flex Consumption VNet integration. The correct delegation is "Microsoft.App/environments". https://stackoverflow.com/questions/63791349/unable-to-connect-to-azure-function-app-after-integrating-into-vnet
- You will need to verify that the private endpoint network policies are set to "Disabled" and the private link service network policies are set to "Enabled" for your subnet. https://stackoverflow.com/questions/63791349/unable-to-connect-to-azure-function-app-after-integrating-into-vnet
- Outbound Traffic Restrictions can be another challenge, so, if you're restricting outbound traffic from your Function App, ensure that it still has access to the necessary resources during deployment. For example, Oryx build commands need access to the internet for successful builds. https://stackoverflow.com/questions/78588084/error-when-assigning-virtual-network-to-the-azure-function
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam