Reputation: 175
I am building a ASP.NET Web Application within Azure DevOps. Within the project artifacts, a .zip file is created during build containing all the .dll files.
I want to add a file within that .zip file so that particular file is included in the Azure Web App when I deploy it. Is it possible to add the file to the zip folder?
Upvotes: 6
Views: 17736
Reputation: 31003
@Murray Foxcroft is correct. The .zip artifact is published by Publish Build Artifacts task, before this task, you could use Copy Files task to copy files from a source folder to a target folder using match patterns, then use Publish Build Artifacts task
to publish the target folder.
Upvotes: 1
Reputation: 13745
Yes, this is possible.
You need to get your file/s to the
$(build.artifactstagingdirectory)
on the build agent in Azure DevOps during the build in order for them to be included in to the zip (Artefacts).
If the file/s to add is in another repository, you can include this repository in your sources and copy it over. You could also use PowerShell to download the files.
This is usually done using the Copy Files Azure DevOps build task.
steps:
- script: ./buildSomething.sh
- task: CopyFiles@2
inputs:
contents: '_buildOutput/**'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: MyBuildOutputs
Top Tips:
Upvotes: 2