Blog Post

Apps on Azure Blog
2 MIN READ

Troubleshooting Connectivity Issues between a Virtual Machine (VM) and an Azure Container App

ronelson's avatar
ronelson
Icon for Microsoft rankMicrosoft
Sep 12, 2024

In today’s cloud-centric world, ensuring seamless connectivity between various components is crucial for maintaining efficient workflows and minimizing downtime. One common scenario involves troubleshooting connectivity issues between a Virtual Machine (VM) and an Azure Container App. This guide aims to provide a fundamental approach to identifying and resolving connectivity issues, covering key aspects such as ingress configurations, troubleshooting tools, and networking components. By following these steps, you can ensure that your VM and Azure Container App communicate effectively.

 

Troubleshooting connectivity issues between a Virtual Machine (VM) and an Azure Container App can involve several steps. 

 

Here are some key steps to perform or check:

  1.  Review ingress configuration
    Scenario Description Actions
    Requests to endpoints fail The container app endpoint doesn't respond to requests. Review ingress configuration

         Troubleshooting in Azure Container Apps | Microsoft Learn

  2. Ensure that the DNS name <UNIQUE_IDENTIFIER>.<REGION_NAME>.azurecontainerapps.io or *.<Custom domain DNS suffix> is correctly resolving to the Container Apps Environment Static IP address 10.0.8.209
    1.  

       

    2. Networking in Azure Container Apps environment | Microsoft Learn
    3. Custom environment DNS suffix in Azure Container Apps | Microsoft Learn
  3. Test connectivity between your VM and the container app using Psping or Test-NetConnections.
  4. Results should show TcpTestSucceeded = True  or PSping <Container Apps Environment Static IP>:<Port> or 
  5. https://learn.microsoft.com/en-us/sysinternals/downloads/psping
  6. For Linux:
    (Need to install corresponding packages)

    tcpping

    tcpping has a few prerequisites for proper usage.

    • Install bc with tdnf install bc -yy
    • Install the awk command - tdnf install gawk -yy
    • Install the traceroute package. See the tcptraceroute section
    • Install the wget package. See the wget section

    Install tcpping with the following:

    cd /usr/bin
    wget http://www.vdberg.org/~richard/tcpping
    chmod 755 tcpping
    

    Confirm this is now installed

     Installing troubleshooting tools in a Container Apps ‘hello-world’ image - (azureossd.github.io)
  7. Note: Tracert returns Timedout due to no option to set the listening port (Avoid using the command)

     

     

  8. You can also use curl -v <Container Apps Environment Static IP> for connectivity. This command should return HTTP 404.
  9.  

  10. If connectivity test fails,

    1. Confirm Target port is correct and ingress settings for your Azure Container App are configured to allow traffic from within the Virtual Network. 
    2.  

    3. Check NSGs associated with your VM and the container app allow traffic on the necessary ports (e.g., HTTP/HTTPS).

    4. Check for Route table forcetunneling traffic to NVA and check any firewall rules that might be blocking traffic to or from the container app.

       


       


       

       

 

Updated Sep 12, 2024
Version 2.0
No CommentsBe the first to comment