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.58k stars 908 forks source link

Error trying to script procedure to create/alter #22605

Closed DellyIan closed 1 year ago

DellyIan commented 1 year ago

Issue Type: Bug

When trying to script a procedure to create/alter keeping getting error after being logged in for a period of time: An error occurred while scripting the objects. Failed to connect to server sql-dfy-uks-sl01.database.windows.net,1433.

Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server sql-dfy-uks-sl01.database.windows.net,1433. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user ''. Token is expired. at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

D:\a_work\1\s\src\Microsoft.SqlTools.ServiceLayer\Scripting\ScriptAsScriptingOperation.cs:line 86

Azure Data Studio version: azuredatastudio 1.42.0 (22f384e569bc90d8b3231cc8c8cff99ea16c5052, 2023-03-17T18:15:48.982Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No Preview Features: Enabled

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 x 2304)| |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)|15.76GB (4.20GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (6) Extension|Author (truncated)|Version ---|---|--- ssmskeymap|kev|1.1.0 admin-pack|Mic|0.0.2 agent|Mic|0.49.0 dacpac|Mic|1.13.0 import|Mic|1.5.4 profiler|Mic|0.12.2
aasimkhan30 commented 1 year ago

@cheenamalhotra is this a connection issue.

cheenamalhotra commented 1 year ago

Hi @DellyIan

The issue can be resolved by enabling 'mssql:enableSqlAuthenticationProvider' setting - it's currently in preview, but can be enabled manually to resolve token expiry issues if they cause concerns in daily operations.

We will be enabling this feature by default in a future release (yet TBD)

cheenamalhotra commented 1 year ago

Closing as issue has now been resolved with May release.