I'm attempting to execute a PowerShell script in Azure DevOps that creates a DACPAC file. The script completes successfully but no file shows up where it's supposed to show up. The script works properly when I run it via the PowerShell client.
The script is run inline. Here's the script:
& $(SqlPackagePath) /TargetFile:$(TargetDacPacFile1) /Action:Extract /SourceServerName:$(SqlServerName1) /SourceDatabaseName:$(DbName1) /SourceUser:$(SourceUser) /SourcePassword:$(SourcePassword)
CodePudding user response:
I resolved the issue. Apparently, Azure Pipelines doesn't have access to the file system AFAIK. I changed the target path from the local file system to $(agent.releaseDirectory)/$(TargetDacPacFile1). I was then able to pick up the DACPAC file in the next activity to deploy it.
If anyone knows how one can view the $(agent.releaseDirectory) directory, I'd appreciate a tip. Thx.
CodePudding user response:
note: not an answer
If anyone knows how one can view the $(agent.releaseDirectory) directory, I'd appreciate a tip
A lot of effort in Azure DevOps is running commands like this to work out where the hell your file is:
- task: CmdLine@2
displayName: Check Build.SourcesDirectory Path
inputs:
script: DIR $(Build.SourcesDirectory) /B /S