Skip to content

fix: Codespace ACR build and push script failure - #688

Open
Priyanka2-Microsoft wants to merge 1 commit into
devfrom
psl-bug-50767
Open

fix: Codespace ACR build and push script failure#688
Priyanka2-Microsoft wants to merge 1 commit into
devfrom
psl-bug-50767

Conversation

@Priyanka2-Microsoft

@Priyanka2-Microsoft Priyanka2-Microsoft commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
  • Resolve an error in the codespace script by encapsulating the image build process in a reusable function, improving maintainability and readability.
    This pull request refactors both the PowerShell (acr_build_push.ps1) and Bash (acr_build_push.sh) scripts used to build and push Docker images to Azure Container Registry. The main improvement is the introduction of reusable functions for building images, which simplifies the scripts and reduces code duplication.

Script refactoring for maintainability and DRY principles:

  • Added a Build-Image function in acr_build_push.ps1 to encapsulate the logic for building images, replacing repeated az acr build commands with function calls for each image. [1] [2]
  • Introduced a build_image function in acr_build_push.sh for the same purpose, replacing repeated az acr build invocations with calls to this function. [1] [2]

BUG ID - https://dev.azure.com/CSACTOSOL/CSA%20Solutioning/_workitems/edit/50767/

Does this introduce a breaking change?

  • Yes

  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • The image build process works correctly for all specified images without errors.

Other Information

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.

Pull request overview

Refactors the ACR build-and-push scripts used in Codespaces/deploy workflows by extracting the repeated az acr build invocation into a reusable helper, improving readability and reducing duplication.

Changes:

  • Add a build_image Bash function to centralize az acr build usage.
  • Add a Build-Image PowerShell function (with exit-code checking) to centralize az acr build usage.
  • Update each image build step to call the new helper functions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
infra/scripts/acr_build_push.sh Introduces build_image() and replaces repeated az acr build blocks with function calls.
infra/scripts/acr_build_push.ps1 Introduces Build-Image and replaces repeated az acr build blocks with function calls plus consistent failure handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants