Unable to deploy the MSSQL Database Project to Azure SQL

Ketan Gohil 0 Reputation points
2025-02-01T06:22:22.2166667+00:00

I am trying to deploy the MSSQL database to azure SQL but the Azure DevOps pipeline is giving error "##[error]Unable to connect to target server 'XXXXXX.database.windows.net,1433'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server."

I have verified following

  • SQL connection credentials (Server, Username, password) are correct. It is Azure SQL.
  • Allowed all IPs and azure services in Azure SQL server. It is allowed 0.0.0.0 to 255.255.255.255 range

Can someone advice what could be the wrong.

Following task in YML giving error,

- task: SqlAzureDacpacDeployment@1

  inputs:

    azureSubscription: '$(azureServiceConnectionStaging)'

    ServerName: '$(staging_dbserver),1433'

    DatabaseName: '$(staging_database)'

    SqlUsername: '$(staging_dbusername)'

    SqlPassword: '$(staging_dbpassword)'

    DacpacFile: '$(build.ArtifactStagingDirectory)\**\$(projectname).dacpac'

    AdditionalArguments: '/p:BlockOnPossibleDataLoss=False /p:TreatVerificationErrorsAsWarnings=true'
Azure SQL Database
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.