Wednesday 9 July 2014

Hybrid Connection - Azure

Microsoft Azure has introduced a new feature called Hybrid Connection. As its name suggests, it allows the azure hosted websites/mobile services to connect to on-premise resources. Though the term "Resources" is quite wide by its definition, Hybrid Connection allows the Azure hosted websites and mobile services to connect to services (e.g. websites, web services, SQL Server, Oracle database Server etc.) hosted on ports defined in the Hybrid Connection created on Azure.

So i thought of trying it out. It was a breeze. I used the tutorial available on Azure site to set up the connection. Then I created a simple website (used default website template of ASP.NET MVC) and added a simple code to read information from a database like following:






"DefaultConnection" pointed to my laptop. Needless to say it worked without any issue even though the stuff was running inside a transaction scope. Now that is not to be mistaken with distributed transaction. That does not work :). In fact even if you try to run two queries on same database, then things fail because DTC does not work over Hybrid Connection as of now. The below code fails.





In all essence, it is quite an interesting feature that can be used for simple websites or mobile services that simply need to access some remote services like intranet website or on-premise database server. 

I am sure that complex scenarios can be enabled but they will not be possible in a straight forward manner. For complex scenarios, recommended approach will to use site-to-site VPN, point-to-site VPN or something else.

Obvious Limitations of Hybrid Connection:
  1. Only SQL Authentication works for SQL Server related communication. Obvious and sensible. 
  2. Distribution transaction coordinator not supported.
  3. Only supported in website and mobile services. Can not be used with Cloud Services.
  4. Nothing that can not be exposed over a port can be used. e.g. File System.

No comments:

Post a Comment