I am using azure devops to deploy a database to a virtual machine via deployment groups. I have verified that the system variable path is correct and also that it works when I log into the virtual machine and try to run it with powershell. I'm not sure why it's not finding it. Any thoughts? Thanks
If someone is looking to resolve this on Azure Release Pipelines and on-prem servers, installing the SSDT from Visual Studio Installer did not help. Had to install the DAC Framework.msi that is mentioned on this link: https://learn.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-ver15&viewFallbackFrom=sql-server-ver17
After installing it from here, the Microsoft SQL Server DAC item showed up in Registry (on Win 2019 server) and then the release pipeline was able to find the SQLPackage.exe file otherwise even though the sqlpackage.exe file was available and SSDT tools from Visual Studio build tools 2017 and 2019 were there but still there was no registry entry (weirdly). Installing this msi fixed that. Hope it saves someone time.
C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\SqlPackage.exe
try to download the package as @Shiva Naru says and point to folder that the installations creates "C:\Program Files\Microsoft SQL Server\160\DAC\bin\SqlPackage.exe"
instead. That solved my problem –
Washin you can use this PowerShell script to locate the path of SqlPackage.exe
I was able to resolve this problem, by adding a Powershell task to my pipeline
- task: PowerShell@2
displayName: 'Install SqlPackage.exe'
inputs:
targetType: 'inline'
script: |
$installerUrl = 'https://download.microsoft.com/download/b/3/0/b30aa612-be4e-46d5-9974-f50cc5e79da7/x64/DacFramework.msi'
$installerPath = Join-Path -Path $env:Agent_TempDirectory -ChildPath 'DacFramework.msi'
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath
Start-Process -FilePath 'msiexec.exe' -ArgumentList "/i `"$installerPath`" /quiet /qn /norestart" -Wait
if (Get-Command 'SqlPackage.exe' -ErrorAction SilentlyContinue) {
Write-Host "DacFx installed successfully."
} else {
Write-Error "DacFx installation failed."
exit 1
}
This way of installing the SqlPackage.exe not only makes sure, that the package is there, but also updates all the required registry references. Thanks to that, the next steps of your pipeline will know where the package is.
© 2022 - 2025 — McMap. All rights reserved.