connect on premise database with azure web app
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