I am trying to deploy dacpac to an existing sql db, and getting the following error:
##[error]*** Could not deploy package.
##[error]Unable to connect to target server ‘AAA.database.windows.net’. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.
Cannot open server
##[error] ‘MyMSSQlServer’ requested by the login. Client is not allowed to access the server.
##[error]The Azure SQL DACPAC task failed. SqlPackage.exe exited with code 1.Check out how to troubleshoot failures at https://aka.ms/sqlazuredeployreadme#troubleshooting-
Here are my steps in release pipeline:
- download: current
artifact: databases
- task: SqlAzureDacpacDeployment@1
displayName: Execute Azure SQL Dacpac
inputs:
azureSubscription: 'MySuvscription'
ServerName: 'MyMSSQlServer.database.windows.net'
DatabaseName: 'AAA'
SqlUserName: 'mysqlserveradmin'
SqlPassword: 'mysqlserverpassword'
DacpacFile: '$(Pipeline.Workspace)databasesfolderafolderbfoldercfolderdMyApp.Database.dacpac'
IpDetectionMethod: AutoDetect
I assumed IpDetectionMethod should handle the access permission. Can anyone suggest how to fix this now?
3
Answers
The error message is showing the Database name where the Server name should be:
Unable to connect to target server ‘AAA.database.windows.net’ instead of ‘MyMSSQlServer.database.windows.net’.
Check if these parameters were entered correctly.
Please make sure you have set the Azure SQL Firewall to allow Azure Services access to the database.