nerdexam
Microsoft

AZ-104 · Question #815

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…

The correct answer is D. Connect webapp1 to VNET1. Connect an App Services Web app to Azure Database for MySQL - Flexible Server in a virtual Add the web app to the virtual network Use az webapp vnet-integration command to add a regional virtual network integration to a webapp. Replace <vnet-name> and <subnet-name with the…

Submitted by tarun92· Mar 30, 2026Implement and manage virtual networking

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?

Options

  • ADeploy an internal load balancer.
  • BPeer VNET1 to another virtual network.
  • CDeploy an Azure Application Gateway.
  • DConnect webapp1 to VNET1.

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    12% (3)
  • C
    4% (1)
  • D
    80% (20)

Explanation

Connect an App Services Web app to Azure Database for MySQL - Flexible Server in a virtual Add the web app to the virtual network Use az webapp vnet-integration command to add a regional virtual network integration to a webapp. Replace <vnet-name> and <subnet-name with the virtual network and subnet name that the Azure Database for MySQL Flexible Server instance is using. az webapp vnet-integration add -g myresourcegroup -n mywebapp --vnet VNETName --subnet webappsubnetName Configure environment variables to connect the database With the code now deployed to App Service, the next step is to connect the app to the Azure Database for MySQL Flexible Server instance in Azure. The app code expects to find database information in a number of environment variables. To set environment variables in App Service, you create "app settings" with the az webapp config appsettings set command. az webapp config appsettings set --settings DBHOST="<mysql-server- name>.mysql.database.azure.com" DBNAME="flexibleserverdb" DBUSER="<username>" DBPASS="<password> https://learn.microsoft.com/en-us/azure/mysql/flexible-server/tutorial-webapp-server-vnet

Topics

#VNet integration#App Service#web app connectivity#virtual network

Community Discussion

No community discussion yet for this question.

Full AZ-104 Practice