I have deployed web app and SQL Database in Region A and SQL database in Region B.
When SQL Database from Region A is down i want my web app to connect SQL database from Region B dynamically.
I have deployed web app and SQL Database in Region A and SQL database in Region B.
When SQL Database from Region A is down i want my web app to connect SQL database from Region B dynamically.
Consider using Azure SQL Database Active Geo-Replication...
https://azure.microsoft.com/en-us/documentation/articles/sql-database-geo-replication-overview/
...combined with a Powershell script (or manual Azure portal config, as you prefer) that:
1) initiates the failover to a secondary SQL replica (which becomes the primary)
https://azure.microsoft.com/en-us/documentation/articles/sql-database-disaster-recovery/
https://msdn.microsoft.com/library/mt619393.aspx
2) updates the web app config to use the new primary replica's connection string
Adding an App Settings to existing Azure Web Application using Azure Power Shell
I'm assuming you're using Azure App Service Web Apps... if not then you'd need some other programmatic means to (for instance) update the web.config of a site deployed in a VM, etc.