Let's say I have a C# WPF application connected with Azure SQL database, everything works fine and my queries work well. The only issue is when sometimes the internet is down, it cannot connect with the database and shows an error at the connection string (which is pretty obvious). Is there any way I can alter my connection string to connect with the database offline, at least be able to view the data, given when the internet is back, the updates are sent to the Azure portal as well (preferably automatic but manual will work). Through some research, I was able to get something as Sync my database with others option in the Azure portal. I was wondering if that's what I am looking for or is there any other alternative that you may suggest?
Thanks.
You can take advantage of Azure SQL Data Sync to sync even a local SQL Server Express database with your Azure SQL Database. Your Azure SQL Database will be configured as a "hub" database and the local SQL Server instance as "member database". You can configure automatic sync on/off and who wins (the hub or the member database) in case of conflicts). You need to configure the sync bi-directional so you can connect to Azure when Internet is available manipulate data and connect locally when there is no Internet connection. Once the Internet connection is restored the can be synced as you have configured it, manually or automatically. You will have to install an Agent on the local computer where SQL Server resides. For information about how to configure SQL Data Sync please visit this tutorial.
Take in consideration tables in your database should have a clustered index to be able to use SQL Data Sync.