Trying to add Azure account on Azure Data Studio but I get the error "request_cannot_be_made" with the message "Token request cannot be made without authorization code or refresh token" and cannot sign in

Nick 5 Reputation points
2026-09-10T15:59:34.31+00:00

I am currently trying to access my SQL server through Azure Data Studio as I need to use it for my work but I am currently unable to access it as it is requiring me to create a new firewall rule and all of the Azure accounts currently linked were deleted and do not exist anymore. I am trying to sign in to the account that I currently use to access the Azure Portal but whenever I try and add it through Azure Data Studio I get the error "request_cannot_be_made" with the message "Token request cannot be made without authorization code or refresh token" and am unable to sign in. I have tried deleting the accessTokenCache file in AppData\Roaming\azuredatastudio\Azure Accounts but this does not help and the issue still persists. Any help with this issue would be much appreciated.error

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.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 10,225 Reputation points
    2026-09-13T17:04:13.8366667+00:00

    Hello @Nick

    The error "request_cannot_be_made" and "Token request cannot be made without authorization code or refresh token" is an authentication/token acquisition error. Since you've already removed the accessTokenCache and the problem persists, this may not simply be a stale cached account.

    However, there's an important consideration here: Azure Data Studio was retired on February 28, 2026, and is no longer supported or receiving security/maintenance updates. Microsoft now recommends migrating to Visual Studio Code with the MSSQL extension for SQL Server and Azure SQL work.

    Because of that, rather than continuing to troubleshoot the Azure Data Studio authentication flow, first try the supported replacement:

    1. Install Visual Studio Code.
    2. Install Microsoft's MSSQL extension.
    3. Add/connect to your SQL Server or Azure SQL instance from the MSSQL Connections view.
    4. Authenticate with the Azure account that currently has access to your Azure subscription.

    You can use existing Azure Data Studio queries, scripts, and SQL database projects in Visual Studio Code without conversion.

    If your immediate requirement is simply to add your current client IP to an Azure SQL Database firewall, you can also do that directly from the Azure portal rather than through Azure Data Studio.

    Go to the Azure SQL logical server containing the database and open:

    Networking > Public access > Firewall rules

    Add your current client IPv4 address and save the configuration. You can then connect to the database using a supported SQL client.

    One other thing I'd verify is whether the account you're using now belongs to the same Microsoft Entra tenant/directory and subscription as the SQL server. You mentioned that the Azure accounts previously stored in ADS were deleted. If the current account belongs to a different tenant, successful Microsoft authentication alone won't necessarily give it access to the Azure SQL resource.

    If authentication also fails in Visual Studio Code/MSSQL, then the problem deserves further investigation as an Entra/MSAL authentication issue. But if VS Code signs in successfully, that strongly suggests you're encountering a problem with the retired Azure Data Studio authentication stack rather than the Azure account itself.

    References:

    What's happening with Azure Data Studio

    Transition from Azure Data Studio

    SQL tools overview


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

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