0

I have a primary sql server1 (server1.database.windows.net) in region A with a single db("demo").

Then,I set up auto failover group for server 1 by creating a secondary server 2 (server2.database.windows.net) in region B for the same db.

When I tried to connect using my-failover-group-name.database.windows.net as the server URL from my springboot app, it does not let me connect.

Currently using the JDBC connection string:-

jdbc:sqlserver://<my-failover-group-name>:1433;database=demo;encrypt=true;trustServerCertificate=false;loginTimeout=30;applicationIntent=ReadWrite;

Am I doing something wrong ? I would greatly appreciate any help.

user2594
  • 386
  • 1
  • 5
  • 18
  • 1
    Do you mean neither of these can be connected? What's your JDK version? Have you checked firewall rule for your Azure SQL Database server? – Joseph Xu Sep 07 '20 at 08:32
  • @JosephXu, Yeah If I want to connect them using server1.database.windows.net or server2.database.windows.net, I am able to connect. But I need my jdbc url in such a way if server1 fails, it automatically redirects to server2. JDK version is 1.8.0_251. – user2594 Sep 07 '20 at 08:38
  • I've made a test using jdbc to connect to a failover group, it works well. What's your error message shows? – Joseph Xu Sep 08 '20 at 02:19
  • @JosephXu, yeah looks like a firewall issue. Got it sorted. Now I am able to connect. Thanks a lot for the help. – user2594 Sep 08 '20 at 12:12

1 Answers1

1

Firstly, please checked firewall rule for your Azure SQL Database server.

Joseph Xu
  • 5,607
  • 2
  • 5
  • 15