I am trying to start Azure Data Studio(1.46.1) from command line to open a file and connect to server and database. I can get it to work separately:

connect with new query

azuredatastudio --server servername --database databasename --authenticationType Integrated

open file disconnected

azuredatastudio "\\server\share\file.sql"

but am unable to open file and connect to server. This will open file but not connect to server and database.

azuredatastudio --server servername --database databasename --authenticationType Integrated "\\server\share\file.sql"

Is there a way to use Azure Data Studio CLI to open and connect to database?

  • 1
    Not sure if this is by design or not but when I try same, ADS creates and opens the connection under SERVERS and a disconnected query window for the file.
    – Dan Guzman
    Oct 13, 2023 at 22:04
  • and it seems like if ADS is already open and connected to server, running CLI to open file connected to server and database works.
    – Bob Klimes
    Oct 17, 2023 at 14:01


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.