When migrating your Azure Function App to a production environment with VNet integration, there are several factors to consider that may cause the issues you're experiencing:
- Service Unavailable Error: When VNet integration is enabled, the Function App may become unreachable externally due to network security group (NSG) rules or firewall settings that are blocking inbound traffic. Ensure that the NSG associated with the subnet where your Function App is integrated allows inbound traffic from the public IP addresses that need to access the Function App.
- Configuration Differences: Since your UAT version works while the production version does not, check for any configuration differences between the two environments. This includes verifying the settings for VNet integration, NSG rules, and any firewall settings that might be present in the production environment but not in UAT.
- Point-to-Site Address Range: If you're using point-to-site VPN connections, ensure that the address range is within the RFC 1918 ranges. If your production environment has a different setup, this could lead to connectivity issues.
- DNS Configuration: Ensure that the DNS settings for your VNet are correctly configured. If the DNS servers are not accessible, it could lead to timeouts and connectivity issues.
- Network Security Groups: Double-check the NSG rules to ensure that they are not blocking the necessary outbound traffic to your SQL servers. You may need to explicitly allow outbound traffic to the SQL port.
- Integration Subnet Delegation: Ensure that the subnet used for integration is properly delegated to
Microsoft.Web/serverFarms. If the delegation is not set, the Function App may not function correctly.
If you continue to face issues, consider using the Network troubleshooter in the Azure portal to diagnose and resolve connection issues. This tool can help check the status of the VNet integration and identify common problems with connectivity.
References: