Skip to content

chore: always produce publishing info for windows VHD builds#8256

Open
timmy-wright wants to merge 3 commits intomainfrom
timmy/always-produce-publishing-info
Open

chore: always produce publishing info for windows VHD builds#8256
timmy-wright wants to merge 3 commits intomainfrom
timmy/always-produce-publishing-info

Conversation

@timmy-wright
Copy link
Copy Markdown
Contributor

@timmy-wright timmy-wright commented Apr 9, 2026

What this PR does / why we need it:

Currently publishing info files are not created for windows test VHD build pipelines. We need them in order to use these VHDs automatically for rp e2e pipelines.

Sample run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=159826599&view=results

Which issue(s) this PR fixes:

Fixes #

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures Windows VHD build pipelines always produce a vhd-publishing-info.json artifact so downstream RP e2e pipelines can automatically consume test-built Windows VHDs.

Changes:

  • Removes the SIG_FOR_PRODUCTION/DRY_RUN gating so the publishing-info generation and artifact publish run for Windows builds.
  • Moves the “Clean Up Packer Generated Resources” step to run after publishing-info artifact publication.
Comments suppressed due to low confidence (1)

.pipelines/templates/.builder-release-template-windows.yaml:231

  • The AzureCLI step that generates the publishing info is missing its list item header (e.g., - task: AzureCLI@2). As written, inputs: is directly under steps: which makes the YAML invalid and will prevent the pipeline from parsing/running. Reintroduce the task line (and ensure indentation matches the surrounding - task steps).
  # Set VHD_NAME and SKU_NAME which will be published.
  # Note: use -a to grep OS_DISK_SAS (packer-output should be read as a binary file in Linux)
  # we always generate these artifacts - sometimes they are used by downstream pipelines even when
  # we are not publishing the image to production.
    inputs:
      azureSubscription: $(VHD_ARM_SERVICE_CONNECTION)
      scriptType: bash
      scriptLocation: inlineScript
      inlineScript: |

@timmy-wright timmy-wright added windows ignore-for-release This pull request will not be included within official release notes labels Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 06:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +239 to +241
export captured_sig_version="$(cat vhdbuilder/packer/settings.json | grep "captured_sig_version" | awk -F':' '{print $2}' | awk -F'"' '{print $2}')"
[ -n "${captured_sig_version}" ] && export VHD_NAME="${captured_sig_version}.vhd";
export STORAGE_ACCT_BLOB_URL="$(echo $OS_DISK_SAS | cut -d "/" -f 1-7)";
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS_DISK_SAS is referenced to derive STORAGE_ACCT_BLOB_URL, but it is never set in this script anymore. With the current logic this makes STORAGE_ACCT_BLOB_URL empty (and likely VHD_NAME mismatched for non-production builds), causing generate-vhd-publishing-info.sh to fail because Windows requires STORAGE_ACCT_BLOB_URL and VHD_NAME to be non-empty. Restore the OSDiskUriReadOnlySas extraction from packer-output (or otherwise populate OS_DISK_SAS), and derive both STORAGE_ACCT_BLOB_URL and VHD_NAME consistently from the same source for the non-production path.

Suggested change
export captured_sig_version="$(cat vhdbuilder/packer/settings.json | grep "captured_sig_version" | awk -F':' '{print $2}' | awk -F'"' '{print $2}')"
[ -n "${captured_sig_version}" ] && export VHD_NAME="${captured_sig_version}.vhd";
export STORAGE_ACCT_BLOB_URL="$(echo $OS_DISK_SAS | cut -d "/" -f 1-7)";
export OS_DISK_SAS="$(grep -a 'OSDiskUriReadOnlySas' packer-output | awk -F': ' '{print $2}' | tail -n 1)"
if [[ -z "${OS_DISK_SAS}" ]]; then
echo "OSDiskUriReadOnlySas was not found in packer-output"
exit 1
fi
export OS_DISK_BLOB_URL="${OS_DISK_SAS%%\?*}"
export VHD_NAME="${OS_DISK_BLOB_URL##*/}"
export STORAGE_ACCT_BLOB_URL="${OS_DISK_BLOB_URL%/*}"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release This pull request will not be included within official release notes windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants