0
votes

I am getting below error while building my project. It seems I am missing data tool components on my build agent

No agent found in pool Hosted VS2017 which satisfies the specified demands: sqlpackage Agent.Version -gtVersion 1.103.0

But I am unable to get offline installer for data tools for VS 2017. Please help.

1
Do you solve this issue with my solution?starian chen-MSFT

1 Answers

0
votes

The sqlpackage.exe is existing on Hosted VS 2017 agent, but not in the capacity list. (can’t add this capacity manually and use deploy database task, check VS2017 Hosted Agent: SQL Server Data Tools)

The workaround is that you can call sqlpackage.exe command by using Command Line task:

  1. Right click your project > Publish to create a publish profile
  2. Edit that publish profile to add Password to TargetConnectionString (Could be tokenized by using Replace Tokens task)

Sample:

<TargetConnectionString>Data Source=XXX.database.windows.net,1433;Persist Security Info=True;User ID=XXX;Password=XXX;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True</TargetConnectionString>
  1. Check in changes
  2. Add Command line task: (Tool: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\sqlpackage.exe; Arguments: /Action:Publish /SourceFile:"$(build.artifactstagingdirectory)\DatabaseDemo.dacpac" /Profile:"$(build.sourcesdirectory)\DatabaseDemo\DatabaseDemo.publish.xml")
  3. Queue build with Hosted VS2017 agent.