azuredatastudio icon indicating copy to clipboard operation
azuredatastudio copied to clipboard

Connection error when attempting to connect to an Azure Database

Open tdoshin opened this issue 3 years ago • 5 comments

  • Azure Data Studio Version:
  • OS Version: Version: 1.35.0-insider (user setup) Commit: 250532f39d2c460f25e646e701bb94d9860d7365 Date: 2022-02-10T06:27:53.725Z VS Code: 1.59.0 Electron: 13.5.0 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19044

Steps to Reproduce:

  1. Under Azure tree -> Tables tree

  2. Right click on any table

  3. Select "Edit Data"

  4. Connection Error Appears (below) image

  5. Connection Details defaults to Azure Active Directory- Universal with MFA Support (below) image

  6. Change the authentication type back to SQL login and enter password/username

  7. Repeat steps 1-4

Alternatively:

  1. Try to create a new server connection with the above details and attempt to connect to it.

Does this issue occur when all extensions are disabled?: Yes/No

tdoshin avatar Feb 10 '22 20:02 tdoshin

This is not just an edit data error, it happens in general when trying to connect to the sever in the screenshot via the new connection button. It appears to be an issue with the STS side and not just edit data strictly. @alanrenmsft @tdoshin

smartguest avatar Feb 16 '22 02:02 smartguest

It seems that when I attempt to debug the 174 version of the extension (where this error did not pop up in the release version), this error pops up in the dev environment, yet it does not in the release version. The connection string between both this and the current version of STS are identical.

smartguest avatar Feb 16 '22 20:02 smartguest

So, it appears the issue occurs when you attempt to connect to a new Azure connection similar to the one that @tdoshin posted (or can be the same one).

This happens when any version of ADS is running in dev mode, attempting to debug STS via attachment (for both main branch and the 174 release that was found in ADS 1.34) on insiders or a 1.34 ADS client, or even replacing the installed STS tools files in an installed 1.34 ADS client with an identical or lower/higher version downloaded from the STS repo page.

The only configuration that doesn't do this and displays a different error is the ADS 1.34 client without any alterations for some reason. (The connection string for the server in the dev version of ADS 1.34 is identical to what is in the current main branch, so that can't be the cause)

The error happens inside Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin when it attempts to run with TdsParser just as a pointer to where the issue occurs.

This means we potentially cannot connect to any Azure Database currently with this bug right now in the current branch.

smartguest avatar Feb 17 '22 00:02 smartguest

Thanks for the investigation @smartguest

tdoshin avatar Feb 18 '22 16:02 tdoshin

We are also experiencing this error and cannot complete the authentication to a Synapse SQL Pool using MFA.

Currently using: Version: 1.37.0 (system setup) Commit: d904740d93d7df76a0ba361f20e4351813b57645 Date: 2022-06-14T01:05:12.352Z VS Code: 1.59.0 Electron: 13.6.6 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.18363

Any update on this is appreciated.

monteholyfield avatar Aug 09 '22 19:08 monteholyfield

Hi @tdoshin

It seems you don't have access to the table data and database as an MFA user. Can you please confirm with help of SSMS? Can you also elaborate what is the expected behavior you were looking at?

cheenamalhotra avatar Sep 01 '22 02:09 cheenamalhotra

Closing due to inactivity.

cheenamalhotra avatar Nov 07 '22 23:11 cheenamalhotra