Create an application gateway for an existing VM

Dan H 20 Reputation points
2023-08-07T16:26:44.3633333+00:00

I have a VM with a public port that I can access over http. I want to support SSL for this VM and for various reasons, i cannot modify the webserver on the VM. Therefore, I am trying to create an application gateway and proxy all traffic through the Application Gateway to the VM. The next step would be to have a SSL connection on the Application Gateway

I am stuck at the point of trying to get traffic from the Application Gateway to the VM. The error I get is Bad Gateway,

I suspect I am missing several steps and am looking for pointers for the entire workflow of starting with an existing VM and then adding the application gateway as compared to going the other way

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,717 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,172 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Durkan 12,221 Reputation points MVP
    2023-08-07T16:32:45.66+00:00

    Hi

    check out similar post here:

    https://learn.microsoft.com/en-us/answers/questions/994824/can-i-add-azure-application-gateway-in-an-existing

    You need a dedicated subnet for the App Gateway and make sure you are not using any reserved naming conventions

    Hope this helps,

    Thanks

    Michael Durkan

    • If the reply was helpful please upvote and/or accept as answer as this helps others in the community with similar questions. Thanks!

  2. ChaitanyaNaykodi-MSFT 27,366 Reputation points Microsoft Employee
    2023-08-11T03:12:30.7633333+00:00

    @Dan H

    Thank you for reaching out and apologies for the delayed response here.

    I understand you are getting a Bad Gateway Error for your Azure Application Gateway which has a website hosted on a VM as a backend pool.

    You can check out this troubleshooting guide here for bad gateway errors in Application Gateway. Below are a few troubleshooting steps from the guide above.

    • NSG, UDR, or Custom DNS is blocking access to backend pool members. If access to the backend is blocked because of an NSG, UDR, or custom DNS, application gateway instances can't reach the backend pool. This issue causes probe failures, resulting in 502 errors.
    • Backend VMs or instances of virtual machine scale set aren't responding to the default health probe. 502 errors can also be frequent indicators that the default health probe can't reach backend VMs.
    • Invalid or improper configuration of custom health probes. When you use custom probes, you can configure the probe interval, the URL, the path to test, and how many failed responses to accept before marking the backend pool instance as unhealthy.

    Hope this helps! Please let me know if you have any additional questions. Thank you!


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.