Cannot connect to Azure Data Studio SQL Server database

John Kozempel 0 Reputation points
2024-09-26T20:47:26.6433333+00:00

I have a simple azure sql server database that I can no longer connect to in Azure Data Studio. When I try to connect via SQL server login, the Create a Firewall Rule screen appears. When I select either "add my client IP" or "add my subnet IP range" I get this error message:

Error: invalid_grant occurred when acquiring token. 9002313 - [2024-09-26 20:44:30Z]: AADSTS9002313: Invalid request. Request is malformed or invalid. Trace ID: 3b9e2e71-98ac-436a-970a-65a7a1835700 Correlation ID: 1a667cea-cbb0-4313-acdd-21236f26882c Timestamp: 2024-09-26 20:44:30Z - Correlation ID: 1a667cea-cbb0-4313-acdd-21236f26882c - Trace ID: 3b9e2e71-98ac-436a-970a-65a7a1835700

I am using the correct credential. I can connect to the database's IP on port 1433. My computer is on the same time zone as the server (east US).

Azure SQL Database
Azure Data Studio
Azure Data Studio
A cross-platform database tool for data professionals using on-premises and cloud data platforms on Windows, macOS, and Linux.
123 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 34,151 Reputation points MVP
    2024-09-26T23:12:03.7333333+00:00

    This issue may be related to a cached token. try to delete the token from the following path on your Windows computer:

    C:\Users{UserNameHere}\AppData\Roaming\azuredatastudio\Azure Accounts

    and try again.

    For MacOS, please find /Users/{your_username}/Library/Application Support/azuredatastudio/Azure Account and remove it.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.