Azure Web App Vnet Integration - Hub and Spoke Scenario
Integrating Web Apps with virtual network allows us to access the resources which is located within our private network space, however web apps will be still be accessible from internet. App Service Environment could be possible solution if you wish to make your Web App completely private.
In this blog I will be discussing the 3 possible use cases.
We need to have the following things to meet the goal with use case 1.
1. Virtual Network - Ansible-vnet - Address Space -10.0.0.0/16
2. Provision a Gateway Subnet - Address Space - 10.0.1.0/24
3. Virtual Network Gateway - WebApp-GW : SKU - VpnGw1
4. Create Point to Site in WebApp-GW - Address Space : 172.16.201.0/24
5. Since, SKU - VpnGw1 is used, IKEv2 VPN should be unchecked. (This can be checked if BASIC SKU in use while provisioning Virtual Network Gateway)
6. Lets Integrate Web App to WebApp-GW
7. Lets go the Gateway and check, if connection has been established by Web App or not.
At the button, you can see the allocated IP.
8. For testing, I have deployedVM in Ansible-Vnet to test connectivity. IP: 10.0.0.6
9. Web App > Advance Tools> Go
10. Click at Debug Console > CMD
11. TCPPING 10.0.0.6:3389 (Make sure RDP port is open or try with any other open port)
Use Case 2 - Hub and Spoke - Perfect World Scenario
Hub VNet Name: Hub-Vnet
Address Space: 10.1.0.0/16
Spoke VNet Name: Spoke-VNet
Address Space: 10.3.0.0/16
Lets establish peering between Hub VNet and Spoke-VNet
Activities to be performed in Spoke-VNet:
1. Goto Spoke-VNet > Click at Peering and + Add
Since, Spoke-VNet does not have gateway, it will use HUB-VNet gateway when required. After sometime, you can see the following
2. There should be two way peering, so lets Go to HUB-VNet and Click at Peering and Add
Here, we have checked "Allow gateway transit" as Spoke-VNet does not have gateway. And, will be using Gateway of HUB-VNet when required to communicate outside.
Once peering is establish you can see the following.
3. Create a VM in Spoke-VNet.
4. Test the connectivity between Web App Integrated with Hub-VNet and VM in Spoke-Vnet. Go to Web App "Hub08" > Advance Tools > Go
With this,web app is communicating with VM deployed in Spoke-VNet.
Use Case 3 - Integrating Web App with Spoke VNet.
Currently, SpokeVNet is peered with Hub-VNet, i.e, "Use Remote Gateway" is enabled. Because of this, we can not spin Virtual Network Gateway in Spoke-Vnet. So, lets uncheck "Use Remove Gateway" from Peering configuration and save it.
1. Remove "Use Remote Gateway" from Spoke-VNet Peering configuratoion and Save it.
2. Create Virtual Network Gateway
Common Error Message:
When you integrate Web App with VNet, it will though a error message as shown below, however if you refresh the page, you will it will show "Connected", its looks like a bug.
In this blog I will be discussing the 3 possible use cases.
- Integrate Web Apps with VNet and verify connectivity between Web App and a VM which is deployed within the same VNet.
- Web App Integration in Hub and Spoke
- Establish connectivity between On-Prem network and Azure Web App
We need to have the following things to meet the goal with use case 1.
1. Virtual Network - Ansible-vnet - Address Space -10.0.0.0/16
2. Provision a Gateway Subnet - Address Space - 10.0.1.0/24
3. Virtual Network Gateway - WebApp-GW : SKU - VpnGw1
4. Create Point to Site in WebApp-GW - Address Space : 172.16.201.0/24
5. Since, SKU - VpnGw1 is used, IKEv2 VPN should be unchecked. (This can be checked if BASIC SKU in use while provisioning Virtual Network Gateway)
6. Lets Integrate Web App to WebApp-GW
7. Lets go the Gateway and check, if connection has been established by Web App or not.
At the button, you can see the allocated IP.
8. For testing, I have deployedVM in Ansible-Vnet to test connectivity. IP: 10.0.0.6
9. Web App > Advance Tools> Go
10. Click at Debug Console > CMD
11. TCPPING 10.0.0.6:3389 (Make sure RDP port is open or try with any other open port)
Use Case 2 - Hub and Spoke - Perfect World Scenario
Hub VNet Name: Hub-Vnet
Address Space: 10.1.0.0/16
Spoke VNet Name: Spoke-VNet
Address Space: 10.3.0.0/16
Lets establish peering between Hub VNet and Spoke-VNet
Activities to be performed in Spoke-VNet:
1. Goto Spoke-VNet > Click at Peering and + Add
Since, Spoke-VNet does not have gateway, it will use HUB-VNet gateway when required. After sometime, you can see the following
2. There should be two way peering, so lets Go to HUB-VNet and Click at Peering and Add
Here, we have checked "Allow gateway transit" as Spoke-VNet does not have gateway. And, will be using Gateway of HUB-VNet when required to communicate outside.
Once peering is establish you can see the following.
3. Create a VM in Spoke-VNet.
4. Test the connectivity between Web App Integrated with Hub-VNet and VM in Spoke-Vnet. Go to Web App "Hub08" > Advance Tools > Go
With this,web app is communicating with VM deployed in Spoke-VNet.
Use Case 3 - Integrating Web App with Spoke VNet.
Currently, SpokeVNet is peered with Hub-VNet, i.e, "Use Remote Gateway" is enabled. Because of this, we can not spin Virtual Network Gateway in Spoke-Vnet. So, lets uncheck "Use Remove Gateway" from Peering configuration and save it.
1. Remove "Use Remote Gateway" from Spoke-VNet Peering configuratoion and Save it.
2. Create Virtual Network Gateway
Common Error Message:
When you integrate Web App with VNet, it will though a error message as shown below, however if you refresh the page, you will it will show "Connected", its looks like a bug.
Comments
Post a Comment