Frank Boucher
Frank Boucher

Reputation: 1864

Grab files from Azure DevOps Release Pipeline

I'm trying to do something I thought was super simple... I want to grab generated files (not built) and copy them to an Azure Blob storage

In my Build the last step of my azure-pipeline.yml look like this:

- task: CopyFiles@2
  displayName: 'Copy generated content'
  inputs: 
    SourceFolder: '$(Build.SourcesDirectory)/output'
    contents: '**\*' 
    targetFolder: $(System.DefaultWorkingDirectory)/$(Release.PrimaryArtifactSourceAlias)/drop
    cleanTargetFolder: true

Then, in the Release I have an Azure CLI step with the inline following code:

az storage blob upload-batch -s "$(System.DefaultWorkingDirectory)/$(Release.PrimaryArtifactSourceAlias)" -d '$web' --account-name frankdemo--account-key '_MYKEY_'

I try different combinations of paths, but nothing works...

Q: What should I put as targetFolder in my build and "-s" in my release?

Upvotes: 0

Views: 1328

Answers (1)

Vova Bilyachat
Vova Bilyachat

Reputation: 19474

You will need to add step so it will publish artifacts

steps:
- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: Server'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
    ArtifactName: Server

Then in your release you can use "Azure File Copy" to copy from your release to blob storatge

Upvotes: 2

Related Questions