Azure / azure-relay-dotnet

☁️ .NET Standard client library for Azure Relay Hybrid Connections

Home Page:https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I connect to a SQL Server database via a hybrid connection?

saeid-p opened this issue · comments

commented

I want to connect to an on-premises SQL server using a hybrid connection. What I'm interested in is establishing a hybrid connection using Service Bus connection string, write a query using the correct connection string, and execute the result. How can I do that without setting up a service on the on-prem server? By setting up service I mean I just want to open a port and provide a SQL Server hostname and access the database. Is this even possible? If so, can you provide a simple C# example to achieve that?

commented

Apparently, this is not possible using Azure Hybrid Connection Manager at this point.
https://stackoverflow.com/questions/50993169/connecting-to-an-hybrid-connection-served-by-the-hybrid-connection-manager

If a cloud service can connect to your SQL server directly then you don't need HybridConnections/HybridConnectionManager.

The whole point of Azure Relay and HybridConnections is for people who cannot open an inbound TCP port and expose their service to the world. In order to use Relay and HybridConnections some agent must be running on-premises which can send to your service which you will not or cannot expose directly to the internet.