connect on premise database with azure web app

Albin Lukose 45 Reputation points
2024-03-20T04:20:02.5533333+00:00

I have an asp.net core web app which is containerized using docker

The app is connecting to a SQL Server, using connection string passed to the docker during deployment.

Th docker image is deployed in azure as a web app.

The connection string is passed as environment variable.

The issue is:

The database I am trying to connect is an on premise database.

So I have created a hybrid connection from my app. The endpoint is the device in which SQL server is installed and the port 1433 .

Endpoint:[MachineName:1433] Name:hybridtest,namespace:bus1433

Installed Hybrid connection Manager on other device and the status is showing as connected.

So I deployed the app in azure and passed this environment variable as connection string

"SqlConnection": "Server=<ip-adress|MachineName>,1433; Initial Catalog=MYDB; User ID=sa;Password=PWD;TrustServerCertificate=True;"

ip-address of the sql servermachine/Device Name

It's not working. How can I resolve this

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

Your answer

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