diff --git a/images.CI/linux-and-win/azure-pipelines/image-generation.yml b/images.CI/linux-and-win/azure-pipelines/image-generation.yml index c83c46d14..750713209 100644 --- a/images.CI/linux-and-win/azure-pipelines/image-generation.yml +++ b/images.CI/linux-and-win/azure-pipelines/image-generation.yml @@ -102,26 +102,6 @@ jobs: PACKER_LOG: 1 PACKER_LOG_PATH: "$(Agent.TempDirectory)/packer-log.txt" - - task: PowerShell@2 - displayName: 'Convert managed image to VHD' - inputs: - targetType: filePath - filePath: ./images.CI/linux-and-win/convert-to-vhd.ps1 - arguments: -SubscriptionId $(AZURE_SUBSCRIPTION) ` - -Location $(AZURE_LOCATION) ` - -ResourceGroupName $(AZURE_RESOURCE_GROUP) ` - -ManagedImageName "$(ManagedImageName)" ` - -GalleryName "github_imagegeneration_convert_to_vhd" ` - -GalleryImageSku "${{ parameters.image_type }}" ` - -GalleryImageVersion "0.0.$(Build.BuildId)" ` - -StorageAccountName $(AZURE_STORAGE_ACCOUNT) ` - -StorageAccountContainerName "images" ` - -VhdName "$(VhdName)" ` - -ClientId $(CLIENT_ID) ` - -ClientSecret $(CLIENT_SECRET) ` - -TenantId $(AZURE_TENANT) ` - -RemoveManagedImage - - task: PowerShell@2 displayName: 'Copy image artifacts to the separate directory' inputs: @@ -166,6 +146,26 @@ jobs: -PrefixToPathTrim "$(TemplateDirectoryPath)" ` -PrintTopNLongest 25 + - task: PowerShell@2 + displayName: 'Convert managed image to VHD' + inputs: + targetType: filePath + filePath: ./images.CI/linux-and-win/convert-to-vhd.ps1 + arguments: -SubscriptionId $(AZURE_SUBSCRIPTION) ` + -Location $(AZURE_LOCATION) ` + -ResourceGroupName $(AZURE_RESOURCE_GROUP) ` + -ManagedImageName "$(ManagedImageName)" ` + -GalleryName "github_imagegeneration_convert_to_vhd" ` + -GalleryImageSku "${{ parameters.image_type }}" ` + -GalleryImageVersion "0.0.$(Build.BuildId)" ` + -StorageAccountName $(AZURE_STORAGE_ACCOUNT) ` + -StorageAccountContainerName "images" ` + -VhdName "$(VhdName)" ` + -ClientId $(CLIENT_ID) ` + -ClientSecret $(CLIENT_SECRET) ` + -TenantId $(AZURE_TENANT) ` + -RemoveManagedImage + - ${{ if eq(parameters.create_release, true) }}: - task: PowerShell@2 displayName: 'Create release for VM deployment'