Raymond Raymond

Create Virtual Network for Azure App Services and Azure SQL Database

event 2021-05-18 visibility 1,929 comment 0 insights toc
insights Stats
Create Virtual Network for Azure App Services and Azure SQL Database

Azure virtual networks can be used to connect Azure resources to each other. Virtual network can also connect to on-premises network using Azure VPN gateway. This article shows the steps required to create a virtual network to connect Azure Web Service to Azure SQL database.

Create virtual network

First, we need to create a virtual network. 

  1. Logon to Microsoft Azure portal.
  2. Search for and navigate to Virtual networks.
  3. Click Create virtual network button or + Create button.
  4. Input virtual network details including subscription, resource group, network name and region.
  5. Input IP addresses details. For this tutorial, I will directly use the default values (
  6. Configure security settings accordingly. 

Add SQL database to virtual network

For existing SQL database on Azure, follow these steps to add it to the virtual network:

  1. Go to Azure SQL server blade.
  2. Click Security -> Firewalls and virtual networks.
  3. Go to Virtual networks section:
  4. Click link '+ Add existing virtual network'.
  5. Input the details and select the previously created virtual network:
  6. Click enable button to enable it.

Add App service to virtual network

For App service plans, only standard and above plans support virtual networks. Thus to add an app service to a virtual network, please ensure you service plan is at least S1:


And also please ensure the region of the VNet is the same as your app service; otherwise you won't be able to select the virtual network to integrate. 

Now follow these steps to add App service to a virtual network:

  1. Go to the App Service blade.
  2. Click Settings -> Networking.
  3. Click 'VNet integration' link in Outbound Traffic card.
  4. Click '+ Add VNet' button:
  5. Select the virtual network:
  6. You can use existing subnet or creating a new one. For this case, I am using the default subnet.
  7. Click OK button to save the changes.
  8. Once it is done, the blade looks like the following screenshot:

Now the SQL database server and App services are both added into the same VNet.

More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts