Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
App Service supports two types of virtual network integration: regional virtual network integration (recommended) and gateway-based virtual network integration (legacy). This article guides you through migrating from the legacy gateway-based approach to the modern regional integration method.
Overview
Regional virtual network integration is the recommended approach for connecting your App Service apps to Azure virtual networks. Unlike gateway-based integration, regional integration doesn't require a VPN gateway and provides superior performance, broader feature support, and enhanced security capabilities.
Why migrate? More than 99% of App Service virtual network integrations use the regional method due to its advantages. Gateway-based integration should only be considered when you need to connect directly to a virtual network in a different region and you can't establish virtual network peering.
Key differences and benefits
Gateway-based integration has significant limitations that regional integration addresses:
Gateway-based integration limitations
Gateway-based integration can't be used in the following scenarios:
- With virtual networks connected to ExpressRoute
- From Linux apps
- From Windows container apps
- To access service endpoint-secured resources
- To resolve App Settings referencing a network-protected Key Vault
- With coexistence gateways supporting both ExpressRoute and point-to-site/site-to-site VPNs
Feature comparison
Feature | Regional virtual network integration | Gateway-based integration |
---|---|---|
Gateway requirement | None | Virtual network gateway required |
Bandwidth | No VPN limitations | Limited by SSTP point-to-site VPN |
Connectivity | Two subnets per App Service plan | Five virtual networks per plan |
Network features | Route tables, NSGs, NAT gateway | Not supported |
Platform support | Windows, Linux, Windows containers | Windows only |
Service endpoints | Full support | Not supported |
Key Vault integration | Network-protected Key Vault app setting support | Not supported |
ExpressRoute compatibility | Full support | Not supported |
Cross-region connectivity | Through global peering only | Direct connection supported |
Performance | Native virtual network performance | VPN overhead |
Scaling | Better resource utilization | Limited by gateway capacity |
Cost | No extra charges | VPN Gateway charges ($19-$525/month) + bandwidth costs |
Prerequisites
Before beginning the migration, ensure you have:
- App Service plan: A Basic, Standard, Premium, PremiumV2, PremiumV3, PremiumV4, or Elastic Premium plan
- Virtual network: A virtual network in the same region as your app
- Subnet: An empty subnet or a new subnet dedicated for virtual network integration
- Permissions: Appropriate RBAC permissions to configure virtual network integration
- Planning: Understanding of your current networking requirements and dependencies
Migration planning and preparation
Important
The migration process is a disconnect/connect operation that will cause downtime. Virtual network integration is slot-specific and doesn't swap during deployment slot operations, requiring careful planning to minimize impact on your applications.
Understanding downtime and impact
The migration involves a complete disconnection from gateway-based integration before connecting to regional integration. During this process:
- Your app loses connectivity to virtual network resources
- Dependencies on private endpoints, service endpoints, or internal services are interrupted
- Downtime typically lasts 2-5 minutes depending on configuration complexity, but can be even longer
Migration strategies
Choose the strategy that best fits your downtime tolerance and operational requirements:
Option 1: Blue-green deployment (minimal downtime)
Best for: Production workloads requiring minimal downtime
- Create a new App Service plan in the same region
- Set up regional virtual network integration on the new plan
- Deploy your application to the new plan with regional integration
- Test thoroughly to ensure connectivity works as expected
- Switch traffic using Azure Traffic Manager, Application Gateway, or DNS changes
- Decommission the old plan after verifying stability
Option 2: Deployment slot testing (minimal downtime)
Best for: Thorough testing with brief production downtime
Since virtual network integration is slot-specific, you can test regional virtual network integration on a staging slot:
- Prepare the integration subnet in advance
- Configure regional VNet integration on your staging slot using the prepared subnet
- Test your application thoroughly on the staging slot with regional integration
- When ready, disconnect gateway-based integration from production and configure regional integration on production
- Swap slots to promote the tested code
Note
Virtual network configurations remain with their respective slots after swapping. After slot swap, your production slot will have the tested application code and the newly configured regional virtual network integration if you configured it on the production slot prior to the slot swap.
Option 3: Direct migration (planned downtime)
Best for: Applications that can tolerate brief downtime
- Schedule during low-traffic periods (nights, weekends)
- Prepare all configurations in advance
- Notify stakeholders of the planned maintenance
- Have rollback procedures ready
Premigration preparation steps
Step 1: Assess your current setup
- Document existing connections: Note which apps use gateway-based integration
- Identify dependencies: Catalog resources accessed through the current integration
- Review networking rules: Document any NSGs, route tables, or firewall rules
- Evaluate downtime tolerance: Determine acceptable maintenance windows
- Plan rollback strategy: Prepare procedures to revert if issues occur
Step 2: Plan your subnet configuration
The subnet used for regional virtual network integration must meet specific requirements:
- Size: Minimum
/28
(16 addresses), recommended/26
(64 addresses) for production - Delegation: Must be delegated to
Microsoft.Web/serverFarms
- Availability: Can't be used by other services simultaneously
- Location: Must be in the same virtual network you want to integrate with
Subnet sizing guidance
Scenario | Recommended Size | Max App Instances |
---|---|---|
Development/Test | /28 (16 addresses) |
11 instances |
Production | /26 (64 addresses) |
59 instances |
Multi-plan subnet join | /26 or larger |
Varies by plans |
Tip
Always provision double the IP addresses of your expected maximum scale to accommodate platform upgrades and scaling operations.
Multi-plan subnet join
You can connect multiple App Service plans to the same subnet using the multi-plan subnet join feature. This approach:
- Requires a minimum
/26
subnet - Allows resource consolidation
- Supports plans across different subscriptions (subnet can be in different subscription)
Step 3: Create the integration subnet
- Navigate to your virtual network in the Azure portal
- Select Subnets > + Subnet
- Configure the subnet:
- Name: Choose a descriptive name (for example
app-service-integration
) - Address range: Select appropriate CIDR block
- Subnet delegation: Select
Microsoft.Web/serverFarms
- Name: Choose a descriptive name (for example
- Select Save
Performing the migration
Same-region migration (most common scenario)
For apps currently using gateway-based integration in the same region:
Step 1: Disconnect gateway-based integration
- Go to your app in the Azure portal
- Select Settings > Networking
- Under VNet Integration, select Disconnect
- Confirm the disconnection
Step 2: Configure regional virtual network integration
- In your app, select Settings > Networking
- Under Outbound traffic configuration, select Not configured next to Virtual network integration
- Select Add virtual network integration
- Choose your virtual network and the prepared subnet
- Select Connect
Step 3: Verify connectivity
After integration is complete, test your app's connectivity to virtual network resources:
- Application testing: Verify your app can access databases, storage, and other resources
- DNS resolution: Confirm DNS queries resolve correctly for private resources
- Performance testing: Monitor application performance after the migration
Cross-region migration
If you're currently using gateway-based integration to connect to a virtual network in a different region:
Set up virtual network peering to enable regional integration:
- Create a virtual network in your app's region
- Establish virtual network peering between regions
- Set up regional virtual network integration with the local virtual network
- Configure routing to access cross-region resources through peering
Post-migration configuration and optimization
After successfully migrating to regional virtual network integration, you can take advantage of other features and optimizations:
- Enhance routing capabilities with advanced traffic routing configurations
- Control outbound traffic with Network Security Groups (NSGs)
- Direct traffic through specific network appliances with User Defined Routes (UDRs)
- Obtain static outbound IP addresses and increase SNAT port availability with NAT Gateway integration
- Enable service endpoints for Azure services
- Connect to Azure services using private endpoints for enhanced security
- Set up private DNS zones for name resolution of private endpoints
Troubleshooting
For common issues and solutions after migration, see Troubleshoot virtual network integration.
Next steps
After successfully migrating to regional virtual network integration, explore these related articles:
Configuration guides:
- Enable virtual network integration in Azure App Service
- Configure virtual network integration routing
- Azure NAT Gateway integration
Learn more about App Service networking:
- App Service networking features overview
- Virtual network integration overview
- Troubleshoot virtual network integration
Related tutorials:
Azure networking documentation: