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.54k stars 899 forks source link

Deploy sql project to new Azure server fails with generic error when password is not complex enough #19440

Open llali opened 2 years ago

llali commented 2 years ago

Steps to Reproduce:

  1. Create a db project targeting Azure
  2. right click on the project and click publish
  3. select "publish to new Azure server"
  4. Select a password which is acceptable for SQL server 2022 (with numbers and upper case) but not in Azure (no special character)

Expected: UI should block and show error because it's not complex enough Actual: it starts creating the server and fails with error "the long running operation has failed. The provisioning state: failed"

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

llali commented 2 years ago

the problem comes from Azure APIs which just returning a general error and not including details. So, there are two problems here. the regrex to verify the password should be different for Azure than SQL server 2022. Also we should check Azure APIs to see if we can get any more details to show in the console

Benjin commented 2 years ago

Workaround for Build: document how to see the error in Azure portal. Added below: https://github.com/microsoft/azuredatastudio/issues/19440#issuecomment-1133153177

llali commented 2 years ago

To find the actual error causing the server creation failed follow the steps bellow:

  1. Go to portal and select the resource group you created the server in
  2. Select "Actively Log" from the left panel
  3. Select the timeline of when the failure happened
  4. Look for operation Name "Update SQL Server"
  5. Open the activity tree node and select the one with status "Failed"
  6. Select the tab "JSON"
  7. Look for any error description or error code. For password complexity the error code was presented in the json "Error code 40632"