Configure Azure Web App to Access Azure VM MySQL Database | Exam AZ-104

Configure Azure Web App

Question

You have an Azure web app named webapp1.

You have a virtual network named VNET1 and an Azure virtual machine named VM1 that hosts a MySQL database. VM1 connects to VNET1.

You need to ensure that webapp1 can access the data hosted on VM1.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D

The correct answer is C. Connect webapp1 to VNET1.

Explanation:

To allow the Azure Web App (webapp1) to access data hosted on the Azure Virtual Machine (VM1), we need to ensure that webapp1 is connected to the same virtual network (VNET1) as VM1. This is because the virtual network acts as a private network that allows resources within it to communicate with each other securely.

Option A - Deploy an internal load balancer: An internal load balancer distributes incoming traffic to resources within a virtual network. While this may be useful for load balancing traffic across multiple instances of webapp1 or VM1, it does not help with connecting webapp1 to VM1.

Option B - Peer VNET1 to another virtual network: Peering VNET1 with another virtual network allows resources in both networks to communicate with each other, but it does not necessarily enable webapp1 to access data hosted on VM1.

Option D - Deploy an Azure Application Gateway: An Azure Application Gateway is a web traffic load balancer that enables web traffic to be managed and secured. While this may be useful for managing incoming web traffic to webapp1, it does not help with connecting webapp1 to VM1.

Therefore, the correct option is C - Connect webapp1 to VNET1.

To connect webapp1 to VNET1, we can use one of the following methods:

  1. Point-to-Site VPN: This method uses a VPN client installed on the webapp1 to connect to the virtual network. This allows the webapp1 to access resources within the virtual network.

  2. Site-to-Site VPN: This method creates a secure connection between the virtual network and an on-premises network, allowing resources in both networks to communicate with each other. This method is useful if VM1 is hosted on an on-premises network.

  3. Azure Virtual Network Integration: This method allows the webapp1 to access resources within the virtual network without requiring a VPN client. This is achieved by creating a point-to-site configuration between the webapp1 and the virtual network gateway.

In conclusion, to allow webapp1 to access data hosted on VM1, we need to connect webapp1 to the same virtual network (VNET1) as VM1 using one of the methods mentioned above.