Monday, 12 November 2018

Connecting to On-Prem SQL Server using Azure Hybrid Connection

In this article, we will explore on connecting to on-premise sql server from Azure services using Hybrid Connections

Hybrid Connections allows Azure Web Sites and Services to securely connect to the on-premises resources hosted within the corporate network, without requiring any change to firewall or network.
Here is a simple console application,which lookup from product table available in on-premise SQL Server DB. Lets publish and host in Azure App Service as WebJob. 
Note: Here we have used the SQL Authentication and provided the SQL Server Instance along with default TCP Port for the SQL Server Connection String.
Now let us configure Hybrid Connection to get the WebJob up and running properly. Inside the App Service select Networking and click on Configure your hybrid connection endpoints. Click on Add hybrid Connection
Create and Configure the Hybrid Connection.
Before  installing and configuring Hybrid Connection Manager in on-prem server, make you  TCP dynamic ports are enabled and Active and Enabled Properties are set to Yes.
Lets install and launch the Hybrid connection manager in the server and then click on Add a new Hybrid Connection; Log in with the Azure Subscription Credentials and select the Hybrid Connection created there Restart the Azure Hybrid Connection Manager Service after adding the connection.
Let us run the WebJob and verify the status from Logs Section. As you can see we have done a lookup from the corresponding Product Id.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.