Cloud to on-premise services using Hybrid Connections

 Cloud to on-premise services using Hybrid Connections

In our integrated solutions, there always exists a component that cannot be hosted in cloud or connection to on-premise client system. The need to keep application components on-premise doesn't have to be a barrier to adopting cloud technologies. With hybrid connections, app components can reside on-premises while interacting with components running in Azure cloud. This blueprint enables teams to manage applications in a way that is consistent across clouds.

How does it work?

The Azure Hybrid connection represents a connection between Azure App Service and TCP endpoint of an on-premise system. The basis of hybrid connection is an Azure Service Bus Relay. The relay can send and receive at both the endpoints – Azure App Service and Hybrid connection Manager. This manager is required to be installed on your on-premise system and interacts with the component over TCP port 80. This eliminates firewall setup to make such connections possible.


SETTING UP AN AZURE HYBRID CONNECTION

I have created a simple web application called SampleHybridDataWebApp. This application will read the content for the page from an on-premise web API ContentWebApplication. The goal is to deploy the SampleHybridDataWebApp on Azure App Service and connect it (by using hybrid connection) to read content from the web API running on my desktop computer.

 CREATING A HYBRID CONNECTION IN AZURE PORTAL

Firstly, I will create an App Service to host the web application. Go to Azure Portal and create App Service (note that App Service with Free or Shared App Service plan do not support hybrid connection so at least Basic B1 plan should be used). Publish your application to the app service. Once the App Service SampleHybridDataWebApp is created, select Networking Ã  Configure hybrid connection endpoints. You will notice that there are 5 connections available (and 0 connections used). The number of connections depends on the selected Application Service plan (the higher plan should be chosen if you need more connections). Select [+] Add hybrid connection to create your first hybrid connection.



  • To set up the hybrid connection, you should identify the port of the service running on your host environment. The common service ports are 1433 for SQL Server, 22 for SFTP, etc.
  • To create the hybrid connection, you need to specify Hybrid connection Name, Endpoint Host (which is local computer hostname), Endpoint Port (have provided the localhost port no 44342 where my on-premise service is hosted and Service Bus namespace (Location and Name).

  • Once the hybrid connection is created, you can see on the dashboard that one connection is used. The connection appears in the list of connections with the initial status “Not connected”. Finally, download the hybrid connection manager (HCM) by using the download link.

 

 

SET UP ON THE ON-PREMISE:

  • Install the program downloaded from Azure Portal on the local computer with the on-premise service. Run the Hybrid Connection Manager UI after, where you can add the hybrid connections that have been previously created on Azure.


  • Select [+] Add a new Hybrid Connection. You might be asked to log in to Azure to list your Azure subscriptions, choose the subscription where you’ve created the Azure Hybrid connection. You can either select and save the connection from the list or provide connection string manually obtained from Azure Portal.
  • The connection appears registered on the local computer. However, the connection status is still “Not Connected” even though the connection was successfully created on Azure.

 

  • The service for Azure Hybrid Connection Manager is installed on downloading the connection manager from portal. The same must be restarted each time, a connection is added to the manger. On restart, the connection in the HCM UI shows connection and ready for test.

 


USING HYBRID CONNECTION

  • To see the Azure Hybrid Connection in action, provide the Uri of the service running in your local machine in the code of App Service and deploy. The SSL certificate of on-premise service is uploaded along with the SampleHybridWebApplication for authentication. It is transported over encrypted TPC tunnel, so the security should not be an issue.

 

  • On browsing to the App Service SampleHybridWebApp, will be able to notice the content read from the on-premise service in my local machine. Azure App Service that hosts my Web App looks for the server/port name in the hybrid connections. The outbound connection to Azure Service Bus Relay is created and connected to on-premise through HCM manager.

 

With Hybrid connection, one can seamlessly make a cloud service connection to on-premise appear as if both exists on the same machine. 

Post a Comment

0 Comments