only the connection string is modified to the relay endpoint.
Connect to on-prem sql server using Azure Relay
Hi,
I would like to connect to a on-prem sql server and execute T-SQL commands to listen and receive SQL broker messages from Azure cloud hosted .net application.
How can i connect to on-prem sql server and execute these sql commands and receive the responses? Looking for solutions and sample code.
I have connection string specified in my .net app...how should I change my connection string or any other code?
My current code in.net (without any relay/hybrid connection)is in below picture. Should I modify this code if I use hybrid connection/Azure Relay? or it is only a configuration required at azure rely and hybrid connections?
2 answers
Sort by: Most helpful
-
-
Bruce (SqlWork.com) 68,636 Reputation points
2024-04-09T19:54:02.98+00:00 for an azure app to connect to you on-prem sqlserver, you need a network connection between them. you have several options:
- expose your sqlserver to directly to the internet so azure can connect to it. not recommend.
- install a vpn between azure and your internal network. this requires special on-prem hardware. see: https://zcusa.951200.xyz/en-us/azure/vpn-gateway/tutorial-site-to-site-portal
- azure express route - an expensive direct connection from your data center to azure. see: https://zcusa.951200.xyz/en-us/azure/expressroute/expressroute-erdirect-about
- azure relay. create a point to point "vlan" with no custom hardware. config the azure relay, and install and configure the on-prem software (windows only). the on-prem software only needs outgoing internet access. see:
https://zcusa.951200.xyz/en-us/azure/azure-relay/relay-what-is-it
note: none these solutions magically turn your sqlserver in a http api server.