Communication between subnets in the same virtual network is not working

Kenneth Webb Vargas 0 Reputation points
2025-05-13T16:24:27.2366667+00:00

I have the following configuration on Azure:

  • Virtual Network: dev-network
  • Subnets:
    • containers: 10.0.0.0/24 delegated to Microsoft.App/environments
    • dev-db: 10.0.1.0/24 (A private endpoint exists to connect a PostgreSQL Flexible Server to this subnet)

The containers subnet is associated to an Azure Container Apps Environment where a Container App hosting service A is trying to connect to the PostgreSQL Flexible Server. Every time the service A tries to establish a connection to the PostgreSQL using the FQDN a connect timeout error is thrown.

I've tried a ping from the Container App that host the service A to the PostgreSQL and find out there is no response.

What configuration is required to establish the communication between the two subnets?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Praveen Bandaru 5,215 Reputation points Microsoft External Staff Moderator
    2025-05-14T21:31:26.3333333+00:00

    Hello Kenneth Webb Vargas

    I understand that you are experiencing an issue connecting the PostgreSQL DB (paas) it is connected via private endpoint from the container apps.

    Both the container apps and the SQL DB are in the same VNET but different subnets. Connectivity and resolution work fine from the test VM, but in the container console, the DNS server IP is taking the loopback IP (127.0.0.11) during resolution. However, a forced nslookup resolves successfully.

    Results: 

     

    /app # nslookup tes**..89os$g&&es.database.azure.com
    Server:         127.0.0.11
    Address:        127.0.0.11:53
    Non-authoritative answer: tes
    .89os$g&&es.database.azure.com     canonical name = tes..89os$g&&es.privatelink.postgres.database.azure.com
    Name:   tes
    .
    **.89os$g&&es.privatelink.postgres.database.azure.com

    Address: 10.0.1.4

    Non-authoritative answer: tes**.89os$g&&es.postgres.database.azure.com     canonical name = tes.**.89os$g&&es..privatelink.postgres.database.azure.com

     

    /app # nslookup tes**.***.89os$g&&es..postgres.database.azure.com 168.63.129.16 Server:         168.63.129.16 Address:        168.63.129.16:53

     Non-authoritative answer: tes**..89os$g&&es..postgres.database.azure.com     canonical name = tes..89os$g&&es.privatelink.postgres.database.azure.com Name:   tes.***.89os$g&&es.privatelink.postgres.database.azure.com Address: 10.0.1.4

     

    Non-authoritative answer: tes**.***.89os$g&&es.postgres.database.azure.com     canonical name = testmeka-db-dev.privatelink.postgres.database.azure.com

    From VM to Postgres sql DB nslookup and psping results

    Nslookup:

    C:\Users\kwebb>nslookup testmeka-db-dev.postgres.database.azure.com Server:  UnKnown Address:  168.63.129.16

     

    Non-authoritative answer: Name:    tes**.***.89os$g&&es.v.privatelink.postgres.database.azure.com Address:  10.0.1.4 Aliases:  testmeka-db-dev.postgres.database.azure.com

    As we determined the issue is within Container App, you have created a new question for this issue here https://learn.microsoft.com/en-us/answers/questions/2275965/communication-from-container-apps-subnet-to-postgr and it is being worked upon by the container app team. After the resolution is achieved, we will add an answer here for community benefit.


    Hope the above answer helps! Please let us know do you have any further queries.

    Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    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.