Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 7 tasks
b3go opened this issue Mar 18, 2024 · 1 comment · May be fixed by #1226
Open
4 of 7 tasks
Labels

Comments

@b3go
Copy link

b3go commented Mar 18, 2024

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 b3go added the bug label Mar 18, 2024
ErikEJ added a commit to ErikEJ/azure-pipelines-extensions that referenced this issue Mar 26, 2024
fixes microsoft#1225

tested and confirmed locally with:

. "$PSScriptRoot/SqlPackageOnTargetMachines.ps1"

Get-SqlPackageOnTargetMachine
@ErikEJ ErikEJ linked a pull request Mar 26, 2024 that will close this issue
2 tasks
@ErikEJ
Copy link

ErikEJ commented Mar 26, 2024

@b3go I did a PR #1226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants