We have 2 SQL Servers on-premise, combined into Availability Group
We want to install windows updates, which will most likely require a reboot of virtual machines, and we are going to use rolling update technique (update secondary replica; fail over to secondary so it becomes primary; update former primary)
Applications that are located on the on-premise web server, are going to be fine, since web-servers' connection strings are pointed to AG Listener
But we also have apps running in Azure,
which are connecting to on-premise DB (to primary DB replica directly) using hybrid connections.
Azure Apps are going to be down if primary replica is down
Question: is there any way that we can point Azure hybrid connections to AG listener ? Or at least redirect hybrid connection to secondary replica if primary is not available for 1-2 mins ?
Best Answer
You should be able to connect to the AG listener from Azure to On-premises or vice versa--though it's not as straight forward as you might think. Here's one of the best article's I've ready today on how to do it.
https://www.concurrency.com/blog/w/creating-a-listener-for-a-multi-subnet-hybrid-or-a
When the AG primary node is on-premises (or in Azure), you should be able to connect to the listener. So you're relying on Azure DNS to do it's job properly and resolve your SQL Azure node correctly. Haven't tried it myself--sounds awesome!