SQL Server and App Service connectivity across subscriptions

JohnTristam 0 Reputation points
2024-04-07T17:27:55.36+00:00

I have two subscriptions, we will call them A and B. Subscription A has an app service that should only be accessible via private endpiont (user's will VPN into the environment via P2S). Subscription B has a SQL Server with a few DB's the app service needs connectivity to. I have created a private endpoint on the app service side, with a private dns zone, and I have done the same on the SQL server side. I also configured VNet integration on the app service side, and connected it directly to the VNet SQL server is on in subscription B.

My understanding is the private endpoint with an app service is only for inbound connections, while the vnet integration would be for outbound. Next, I went to the private dns zone in Subscription A for the app service, and linked it to the SQL Servers VNet in subscription B. In my head, this should give the SQL server connectivity to the app service inbound via private link service without the need for a VNET peer, and the VNet integration should work for outbound as the app service is directly integrated with the SQL servers VNET.

That being said, when testing, I am still unable to get connectivity from resource to resource. What am I missing? Do I need to add the app settings similar to what is mentioned here: https://techcommunity.microsoft.com/t5/apps-on-azure/access-to-web-app-behind-a-private-endpoint/m-p/2122208/highlight/true#M215

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,146 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
462 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,737 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,901 questions
{count} votes

2 answers

Sort by: Most helpful
  1. KapilAnanth-MSFT 35,001 Reputation points Microsoft Employee
    2024-04-08T17:52:25.86+00:00

    @JohnTristam ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    From your verbatim,

    1. You have an AppService (from SubscriptionA) integrated into a VNETB in SubscriptionB
    2. You have a SQL Service (from SubscriptionB) with a PrivateEndPoint in VNETB in SubscriptionB
    3. You have a PE for AppService (from SubscriptionA) in the VNETA (SubscriptionA)

    "My understanding is the private endpoint with an app service is only for inbound connections, while the vnet integration would be for outbound"

    • Yes, this is correct.

    "I went to the private dns zone in Subscription A for the app service, and linked it to the SQL Servers VNet in subscription B. In my head, this should give the SQL server connectivity to the app service inbound via private link service without the need for a VNET peer"

    • Incorrect
    • Private DNS Zone is only for name resolutions, this does not provide connectivity.
    • From your verbatim, Point 3,
    1. A PE only provides inbound connectivity for resources that are connected to the VNET in which the PE resides.
    2. In this case, VNETA is where the PE resides.
    3. And VNETA is not connected to VNETB, Hence no resource in VNETB can access the AppService PE in VNETA

    If my observation of your existing architecture is incorrect - Please share an architecture diagram as to avoid confusions

    Now,

    Your requirement is to provide bidirectional connectivity between AppService and the SQL Servers. Correct me if I am wrong.

    • You having AppService Integration in VNETB and a PE for SQL Service in VNETB provides App Service access to SQL via PE. (this is unidirectional)
    • Now, unless and until
    1. you integrate the SQL Service to the VNETB
    2. and create a PE for AppService in VNETB
      The SQL Service cannot access the App Service.

    However, I do not understand why you would need inbound access from Azure SQL Service to App Service in the first place.

    • AFAIK, Azure SQL Service cannot make outbound connections.
    • Can you please elaborate how exactly are you testing the "connectivity from Azure SQL Service" to the App Service?

    Cheers,

    Kapil


  2. Silvia Wibowo 2,931 Reputation points Microsoft Employee
    2024-04-18T00:34:35.9466667+00:00

    Users --(1)--> App Service --(2)--> SQL DB (no public access)

    For (2): App Service need vNet integration with vNet B. SQL DB needs a Private Endpoint in the same vNet (vNet B).

    For (1): If you require that App Service is not publicly accessible, create a Private Endpoint in vNet A. Users then VPN into vNet A to access App Service via Private Endpoint.

    0 comments No comments