Edit

Share via


Migrate from gateway-based to regional virtual network integration

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

  1. Create a new App Service plan in the same region
  2. Set up regional virtual network integration on the new plan
  3. Deploy your application to the new plan with regional integration
  4. Test thoroughly to ensure connectivity works as expected
  5. Switch traffic using Azure Traffic Manager, Application Gateway, or DNS changes
  6. 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:

  1. Prepare the integration subnet in advance
  2. Configure regional VNet integration on your staging slot using the prepared subnet
  3. Test your application thoroughly on the staging slot with regional integration
  4. When ready, disconnect gateway-based integration from production and configure regional integration on production
  5. 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

  1. Schedule during low-traffic periods (nights, weekends)
  2. Prepare all configurations in advance
  3. Notify stakeholders of the planned maintenance
  4. Have rollback procedures ready

Premigration preparation steps

Step 1: Assess your current setup

  1. Document existing connections: Note which apps use gateway-based integration
  2. Identify dependencies: Catalog resources accessed through the current integration
  3. Review networking rules: Document any NSGs, route tables, or firewall rules
  4. Evaluate downtime tolerance: Determine acceptable maintenance windows
  5. 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

  1. Navigate to your virtual network in the Azure portal
  2. Select Subnets > + Subnet
  3. 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
  4. Select Save

Performing the migration

Same-region migration (most common scenario)

For apps currently using gateway-based integration in the same region:

Diagram showing migration from gateway-based to regional virtual network integration.

Step 1: Disconnect gateway-based integration

  1. Go to your app in the Azure portal
  2. Select Settings > Networking
  3. Under VNet Integration, select Disconnect
  4. Confirm the disconnection

Step 2: Configure regional virtual network integration

  1. In your app, select Settings > Networking
  2. Under Outbound traffic configuration, select Not configured next to Virtual network integration
  3. Select Add virtual network integration
  4. Choose your virtual network and the prepared subnet
  5. Select Connect

Step 3: Verify connectivity

After integration is complete, test your app's connectivity to virtual network resources:

  1. Application testing: Verify your app can access databases, storage, and other resources
  2. DNS resolution: Confirm DNS queries resolve correctly for private resources
  3. 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:

  1. Create a virtual network in your app's region
  2. Establish virtual network peering between regions
  3. Set up regional virtual network integration with the local virtual network
  4. 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:

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:

Learn more about App Service networking:

Related tutorials:

Azure networking documentation: