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.52k stars 894 forks source link

Publishing an sqlproj creates database unpromptedly #17749

Open adriennn opened 2 years ago

adriennn commented 2 years ago

Steps to Reproduce:

  1. Create a new sqlproject
  2. Right click on root of project, click on "Publish"
  3. The dialog that appears contains the name of the project as the target database before any target server is selected
  4. if the user quickly enough selects the server to which to deploy the database, the name of the sql project stays in selection and is used as the basis for the creation of an entirely new database in azure, generating cost without prompting user
kisantia commented 2 years ago

@adriennn the current behavior is by design and the same behavior as SSDT. If the selected connection is to a specific database on the server, then the default database name gets replaced with that instead of the project name.

Is there an alternative behavior that you would prefer?

adriennn commented 2 years ago

hello @kisantia

Is there an alternative behavior that you would prefer

if the user interface allows for deploying a new resource by inadvertence then definitely an alternative behavior is needed, in this case, perhaps like so:

  1. Publish button is disabled
  2. User selects a server
  3. UI waits for database list from server
  4. if there are no database on servers, enable Publish button with label "Publish to New Database"
  5. if there is a database on the server, enable publish button to with label "Publish"