Connect an App Service Web app to a SQL Server database inside a Virtual Machine

FERNANDO VENDRAMIN 101 Reputation points
2021-08-02T14:29:16.04+00:00

Hi,

I'm migrating an ASP.NET Web Site to Azure Stack Hub App Service.

The Web Site uses a SQL Server database, I have instaled a Virtual Machine in the same Resource group as the App Service but the Web Site can't connect to the database.

I have tried with the private and public IP but nothing.

How can this be accomplish?

Thanks!
I

Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
183 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,361 questions
{count} votes

Accepted answer
  1. FERNANDO VENDRAMIN 101 Reputation points
    2021-08-05T13:02:15.677+00:00

    The SQL Server instance was a named instance and the SQL Server Browser service was stopped....

    Telnet testing to 1433 worked fine, but without that service connection to named instances do not work

    Now it works perfectly!!

    Thank you all for the support

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Ryan Hill 27,026 Reputation points Microsoft Employee
    2021-08-04T03:02:32.18+00:00

    Here a few things to check @FERNANDO VENDRAMIN ,


  2. AndrewW-MSFT 81 Reputation points Microsoft Employee
    2021-08-04T20:06:16.337+00:00

    Hi @FERNANDO VENDRAMIN , want to clarify a couple of items here:

    1. The VM on which you have deployed SQL Server is in the same resource group as the Web App, correct?
    2. Have you opened the necessary ports on the VM firewall to allow inbound traffic to SQL Server (usually port 1433 TCP as a minimum)?
    3. You will need to configure your connection string to point to the Public IP of the VM as there is not support for VNET integration in Azure Stack Hub.

    Thanks

    Andrew