microsoft/azure-pipelines-extensions

[BUG]: SqlPackageOnTargetMachines.ps1 isn't able to find sqlpackage.exe from Visual Studio installation

b3go opened this issue · 1 comments

b3go commented

New issue checklist

Extension name

TaskModuleSqlUtility

Extension version

No response

Issue Description

The powershell script SqlPackageOnTargetMachines.ps1 is unable to pick up sqlpackage.exe from Visual Studio 2022 installations.

Bug in this line:

$dacFullPath = [System.IO.Path]::Combine($sqlDacLocation.FullName, "SqlPackage.exe")

the sqlpackage.exe exists directly under the path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC. The script is looking for sqlpackage.exe in subfolders but there are none.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

Azure DevOps Server 2022.1 patch 3

Operation system

Windows Server 2019

Relevant log output

##[debug]vswhere.exe location:'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe'
##[debug]Latest Visual Studio (version: '17.9.34701.34)' found at: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise'
##[debug]Visual Studio install location: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Unable to find Dac framework installed with Visual Studio at  on machine SERVERNAME
##[debug]Visual Studio versions found on machine SERVERNAME as read from registry: 17.0 16.0 15.0 14.0 12.0 11.0 10.0 8.0
##[debug]Dac Framework (installed with Visual Studio) not found on machine SERVERNAME

This currently leads to this publish error if the build agent is updated to the newest visual studio version: microsoft/DacFx#427

@b3go I did a PR #1226