diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index ae103ed28868..9df0b3ffa6ef 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -55,7 +55,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') }}: