skip to Main Content

I have been looking up quite some time on the subject of pipelines, but strangely, I cannot get to find an answer for this very simple scenario I have.

Thing is, the releases to our software need to be published as a easily downloadable and versioned file/s or installer. Why? Because due to the nature of the bussiness, target environments do not have internet connection, so we need to offer manually downloadable distributable files/installer to manually install them.

I have tried different things but these don’t seem to work for me:

  • Publish as a "Pipeline Artifact": This option doesn’t work in classic Release Pipelines (it throws an error "Cannot upload to a pipeline artifact from release environment.").

  • Publish as a "Build artifact": If I do it in a build pipeline, it will defeat the purpose of separation between "build" and "release" pipelines. Even if I did it anyway, it will be published as a "build" artifact, which will be very hard to reach in the Azure Devops web app: Pipelines>(Pipeline name)>(browse run name)>Artifacts>Artifact name, which also gets deleted like 30 days after.

  • Publish with "Universal Publish": This option seems to be very apt, since releases are added into the Azure Artifacts feed with a corresponding version number in a very "official" manner (i yet have to see how to assign this version number dynamically from build stage). But the problem is that apparently it’s not possible to download universal packages from Azures Web App UI for technical reasons. Instead, I have to use Azure CLI. But i need to be able for me or any team member to download this artifact easily and without installing additional software or technical knowledge.

Am I missing something here?

Some considerations: we only have an Azure Devops plan, no other Azure services (storage, etc).

2

Answers


  1. If you do not want to use additional components, you may use Publish as a "Build artifact". In this case, you may retain the needed builds:

    enter image description here

    Then use rest API to get the download link: Get Artifact

    It should be in the following format:

    https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&api-version=7.2-preview.5&%24format=zip
    
    Login or Signup to reply.
  2. As mentioned in the question description, currently the out of the box way in Azure Devops are using Build Artifacts and Universal package to save the distributable files.

    However, since you need to upload in the release pipeline and support downloading directly on the Azure DevOps UI, the above methods have limitations.

    I’m afraid there’s no out-of-the-box method can fully meet your requirement.

    For a workaround, you can consider using logging command in Release Pipeline to upload the files to Release Pipeline log.

    You can zip all distributable release files and add the powershell/bash task to run the logging command:

    echo "##vso[task.uploadfile]$(System.DefaultWorkingDirectory)xxx.zip"
    

    For example:

    enter image description here

    Or you can use the existing Azure DevOps extension: Publish and Download Artifacts from Release Pipelines. It can achieve the same feature.

    Then the related files will be upload the release Pipeline log.

    You can download the log and see the files.

    enter image description here

    enter image description here

    This method also has limitations in that it cannot directly obtain the required files. But it can be used in Release Pipeline and supports direct download on the page.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search