4

I azure we can create Hybrid connection to local sql server from Web Sites and Mobile Service. But I need to create Hybrid service to My Local SQL server from VM or cloud service. Is there anyway to achieve this one?

pnuts
  • 58,317
  • 11
  • 87
  • 139

2 Answers2

2

You can, actually.

The tool is called the Microsoft Azure Hybrid Connection Client

This runs as a service on your VM, and you add Hybrid Connections to it.
(That is, it = the VM that needs to talk to the on-prem asset.)

When a connection is added, a HOSTS file entry is made for the particular dns name and is routed through Azure to your on-prem Hybrid Connection Manager.

The Connection String you add will be the 'Application' one(s), which you will find in the old portal

JoeBrockhaus
  • 2,745
  • 2
  • 40
  • 64
  • 1
    Hi Joe, any detailed step by step example please? I have similar requirements, have a website1 hosted in a cloud VM, needs to call api of another website2 which is hosted on-premises. – J.W Nov 13 '21 at 03:49
  • HI @J.W - I do not have any detailed examples, though the Connection Client itself was pretty self-explanatory. IIRC, it was almost identical to the _server-side_ component (Connection Manager) which is installed to the on-premises device to provide network access. You create the Connection in the Portal, then Add that Connection to 'both sides' using the Manager (not linked) + Client (linked above). – JoeBrockhaus Nov 17 '21 at 00:52
  • With this said, the instructions I originally added reference the Old Portal, which no longer exists, and I'm unsure if you're able to get these connection strings anymore. It was also during the period when the service was switching between legacy BizTalk Services + Azure Relay. Though it's billed as a seamless transition, this is definitely esoteric usage, so YMMV. – JoeBrockhaus Nov 17 '21 at 00:54
  • Check here for more updates on how to create the connection. https://learn.microsoft.com/en-us/azure/azure-relay/relay-hybrid-connections-protocol Once you've created the connection in Azure, and successfully connected the backend using the Manager component, try using the tool linked above on your Cloud VM. Now that I think about it, you should be able to discover the connection strings used by the on-premises Manager (stored in its app.config). – JoeBrockhaus Nov 17 '21 at 00:57
-1

According to Microsoft Hybrid connection will support only for WebSite and Mobile Web Services.

So I couldn't directly achieve my requirement. But alternative way is, implement the WCF service which can be hosted as WebSite.Now you can hosted your SQL database locally and create hybrid connection to the database from WCF service.Then you can call your WCF service from VM or cloud service.

Thanks, Erandika