microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
275 stars 424 forks source link

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

Open b3go opened 3 months ago

b3go commented 3 months ago

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: https://github.com/microsoft/azure-pipelines-extensions/blob/ae1eb2b556298beb949fc61e885e55fc18abed07/TaskModules/powershell/TaskModuleSqlUtility/SqlPackageOnTargetMachines.ps1#L327

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)

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: https://github.com/microsoft/DacFx/issues/427

ErikEJ commented 3 months ago

@b3go I did a PR https://github.com/microsoft/azure-pipelines-extensions/pull/1226