2
votes

The end goal of this is to be able to expose a on-prem SQL Server so that it can be connected to like a 'regular' SQL Server using Azure. I'm trying to avoid doing a Azure Data Sync as I don't want to 'copy' data in this situation, although I will probably have to fall back to that if this doesn't work out.

So far, I've created an Azure Hybrid Connection to the SQL Server and now I'm trying to connect to the SQL Server through the Hybrid Connection.

I've managed to connect to the Hybrid Connection by creating an SAS token and connecting. However, now, I'm thoroughly stumped on how to pass a connection through that connection if that makes any sense.

I've tried using Stream classes but those don't seem to fit what I want to do in this situation. I'm having trouble googling or searching on StackOverflow because of how convoluted this whole thing is.

Is this even possible? Is there some class or library that I'm missing here?

1
I've never used them before but I assume they are meant to provide transparent network connectivity. The page says "each Hybrid Connection correlates to a single TCP host and port combination" So first thing to try is to just use a standard SQL Server connect string and connect using the normal SQL Server libraries. If that doesn't work, try an IP address instead of a host name.Nick.McDermaid

1 Answers

1
votes

According to your description, you could follow the steps below:

1) Create Hybrid Connections via your App Service app in Azure Portal, details you could follow Add and Create Hybrid Connections in your app.

2) Go to "Networking > Configure your Hybrid Connection endpoints" of your App Service app, then click Download connection manager or HybridConnectionManager.msi for downloading the Hybrid Connection Manager. You could sign in with your Azure account, choose your subscription, select the hybrid connections that you want the HCM to relay or you could select enter manually int the HCM with the Hybrid connection string from Azure Portal. Details you could follow Hybrid Connection Manager.

Moreover, you could follow Accessing on Premise SQL Server Database From Azure Web App Using Azure Hybrid Connection, though it uses the older BizTalk Hybrid Connections.