diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index bcd377973d53..0e465f3cbbbd 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -59,7 +59,7 @@ jobs: artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' displayName: "Archive sonic image" - publish: $(Build.ArtifactStagingDirectory) - condition: failed() + condition: or(failed(), canceled()) artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)' displayName: "Archive failed sonic image" - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: