Skip to content

Install Az.Storage for release storage publishing jobs - #28323

Merged
Justin Chung (jshigetomi) merged 2 commits into
PowerShell:masterfrom
jshigetomi:jshigetomi-port-storage-publishing-fix
Nov 4, 2026
Merged

Justin Chung (jshigetomi) merged 2 commits into
PowerShell:masterfrom
jshigetomi:jshigetomi-port-storage-publishing-fix

Conversation

@jshigetomi

Copy link
Copy Markdown
Collaborator

PR Summary

  • Port the temporary AzurePowerShell task pin as its own commit to preserve the original release-fix history.
  • Port the follow-up durable fix that restores AzurePowerShell@5 and explicitly installs and imports Az.Storage 9.7.2 for all three storage-publication jobs.

PR Context

The release publishing jobs depended on Az.Storage being present in the hosted image. Pinning the Azure PowerShell task revision did not restore New-AzStorageContext, so the follow-up removes that image dependency by installing the required module from PowerShellGalleryMirror and importing the exact version before storage commands run.

The two directly related source commits are preserved separately and in order. Both applied cleanly to current master without conflict-resolution changes.

Validation:

  • python -c "import yaml, pathlib; files=[pathlib.Path(r'.pipelines\templates\release-MakeBlobPublic.yml'), pathlib.Path(r'.pipelines\templates\release-upload-buildinfo.yml')]; [yaml.safe_load(p.read_text(encoding='utf-8')) for p in files]; print('Parsed YAML:', ', '.join(str(p) for p in files))" — Passed; both changed templates parsed successfully.
  • git diff --check origin/master...HEAD — Passed.

PR Checklist

Justin Chung added 2 commits November 3, 2026 21:20
## Summary
- Pin both PSInfra blob publication tasks to `AzurePowerShell@5.280.3`.
- Pin the BuildInfo publication task to the same known-good task revision.

## Reason
Release build [733701](https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=733701) resolved `AzurePowerShell@5` to a newer task revision and all three jobs failed because `New-AzStorageContext` was unavailable. Successful release build [732392](https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=732392) used task revision `5.280.3`.

## Validation
- Verified exactly three task references were changed.
- `git diff --check` passed.

After merge, retry the `Make Blob Public` and `Upload BuildInfo.json` release stages; binaries and packages do not need rebuilding.

----
#### AI description  (iteration 1)
#### PR Classification
CI/build pipeline configuration change to pin a task version for release stability.

#### PR Summary
Pinned the `AzurePowerShell` task version from `@5` to `@5.280.3` across pipeline templates to ensure consistent and reproducible behavior for the v7.7.0-rc.1 publishing process.
- `release-MakeBlobPublic.yml`: Pinned two instances of the `AzurePowerShell` task to version `5.280.3`.
- `release-upload-buildinfo.yml`: Pinned the `AzurePowerShell` task to version `5.280.3`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
## Summary
- Install `Az.Storage 9.7.2` from the internal `PowerShellGalleryMirror` Azure Artifacts feed in each storage-publication job.
- Explicitly import `Az.Storage 9.7.2` before invoking storage commands.
- Restore the tasks to `AzurePowerShell@5`; pinning task version `5.280.3` did not address the image dependency change.

## Reason
Release run [734624](https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=734624) confirmed the exact task pin was honored, but `New-AzStorageContext` remained unavailable on `PSMMS2019-Secure 29.0.0`. Successful run [732392](https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=732392) used image version `27.0.0`, which contained the storage module.

This change removes the release jobs' dependency on the floating image's module inventory.

## Validation
- Verified exactly three storage-publication jobs were updated.
- `git diff --check` passed.

After merge, rerun only `Make Blob Public` and `Upload BuildInfo.json`; binaries and packages do not need rebuilding.

----
#### AI description  (iteration 1)
#### PR Classification
CI/CD pipeline fix to ensure the correct `Az.Storage` module version is installed for release publishing tasks.

#### PR Summary
This PR updates release pipeline templates to explicitly install and import `Az.Storage` version 9.7.2 before executing Azure PowerShell tasks, replacing the pinned `AzurePowerShell@5.280.3` task version with `AzurePowerShell@5`.
- `release-MakeBlobPublic.yml`: Adds steps to register the PowerShell Gallery mirror repository and install `Az.Storage` 9.7.2 before blob copy tasks; imports the module explicitly in inline scripts.
- `release-upload-buildinfo.yml`: Adds similar module installation step before uploading build JSON to blob storage, and imports `Az.Storage` 9.7.2 in the inline script.
- Both files downgrade the `AzurePowerShell` task version from `5.280.3` to `5` to use the latest compatible version.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
@jshigetomi
Justin Chung (jshigetomi) requested a review from a team as a code owner November 4, 2026 03:21
Copilot AI balanced review requested due to automatic review settings November 4, 2026 03:21
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Release publishing requires validation on PSMMS2019-Secure of mirror access and Az.Storage 9.7.2 compatibility with AzurePowerShell@5’s selected Az.Accounts version, neither of which YAML parsing establishes.

No open issues 🎉

What changed in this PR

This PR removes release storage publishing jobs’ reliance on a preinstalled Az.Storage module by explicitly installing and importing version 9.7.2.

Changes:

  • Registers PowerShellGalleryMirror when needed and installs the pinned module in all three storage-publication jobs.
  • Imports the exact version before storage commands run in AzurePowerShell@5.
File Description
.pipelines/​templates/​release-upload-buildinfo.yml Installs and imports Az.Storage for build-info uploads.
.pipelines/​templates/​release-MakeBlobPublic.yml Installs and imports Az.Storage for both blob-copy jobs.

Review effort: Balanced

@jshigetomi Justin Chung (jshigetomi) added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.6.x-Done CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants