microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.56k stars 899 forks source link

Doesn't want to re-authenticate with Azure/ADX #23192

Open d3lboy opened 1 year ago

d3lboy commented 1 year ago

Issue Type: Bug

Can't open the previously created connection to Azure Data Explorer, using Azure Active Directory - Universal with MFA support. It works well if you add it for the first time, but after few days of inactivity it tries to connect, but it throws an exception (see the image).

image

It says that "the refresh token has expired", but it is not possible to re-authenticate, to get a new set of tokens. Wouldn't it be an expected behavior to open a new browser window and do the authentication again?

Currently, it is stuck here, it refuses to connect, but it doesn't offer to re-authenticate.

Azure Data Studio version: azuredatastudio 1.43.0 (b790d700898b1095d83e62f0de14678a58222520, 2023-04-10T23:14:27.236Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2592)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.78GB (10.64GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (2) Extension|Author (truncated)|Version ---|---|--- azuremonitor|Mic|0.1.9 kusto|Mic|0.5.8
cheenamalhotra commented 1 year ago

Hi @d3lboy

ADS now prompts to refresh credentials when this error occurs, with latest release v1.44 (released today), have you given it a try?

d3lboy commented 1 year ago

Hi @cheenamalhotra ,

Unfortunately, the result is the same in this 1.44 version also. Now I can refresh Azure account/credentials, see all resources from my subscriptions, but I can't connect to ADX. Firstly, it asks for an additional auth image

then it says: image

Signing in and writing queries in the browser (https://dataexplorer.azure.com/) works without single problem.

cheenamalhotra commented 1 year ago

Can you confirm your connection string/properties include datasource/cluster name in the correct format as below:

https://{ClusterName}.{Region}.kusto.windows.net

The screenshot seems to include extra info out of format.

d3lboy commented 1 year ago

image