Skip to content

Use cacheImageName for local development environments#2328

Open
frottke wants to merge 3 commits into
microsoft:mainfrom
frottke:main
Open

Use cacheImageName for local development environments#2328
frottke wants to merge 3 commits into
microsoft:mainfrom
frottke:main

Conversation

@frottke

@frottke frottke commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the existing cacheImageName setting when creating a local development environment.

CreateDevEnv currently passes an empty imageName to Run-AlPipeline, regardless of the configured cacheImageName. As a result, local development environments cannot use the cached Business Central images already supported by AL-Go and BcContainerHelper.

Problem

When imageName is empty, BcContainerHelper creates the container from the generic Business Central image and installs Business Central from the selected artifacts during every container creation.

When a configured image name is passed, BcContainerHelper can create or reuse an artifact-specific image. Subsequent container creation can then use the prepared image instead of repeating the Business Central installation.

A local comparison demonstrated the difference:

With imageName set to my

BcContainerHelper found and reused the existing artifact-specific image:

ArtifactUrl and ImageName specified
Image my:onprem-28.3.52162.52222-de already exists
Using image my:onprem-28.3.52162.52222-de
Creating container erp-ci from image my:onprem-28.3.52162.52222-de

The Business Central installation step was not executed again.

The complete container creation took 237 seconds in this run.

With an empty imageName

BcContainerHelper used the generic image:

Using image mcr.microsoft.com/businesscentral:ltsc2025
Creating container erp-ci from image mcr.microsoft.com/businesscentral:ltsc2025
Using artifactUrl https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/onprem/28.3.52162.52222/de
Installing Business Central
Installing from artifacts

The Business Central installation alone took 209 seconds, and the complete container creation took 446 seconds in this run.

These timings are an observed example rather than a controlled benchmark, but the logs demonstrate the behavioral difference: using the cached image avoids repeating the Business Central installation when a matching image already exists.

Change

For local development environments, pass the existing cacheImageName setting to Run-AlPipeline instead of always passing an empty value.

             $sharedFolder = ""
             if ($project) {
                 $sharedFolder = $baseFolder
             }

+            $imageName = ""
+            if ($kind -eq "local") {
+                $imageName = $settings.cacheImageName
+            }
+
             Run-AlPipeline @runAlPipelineParams `
                 -accept_insiderEula:$accept_insiderEula `
                 -vsixFile $settings.vsixFile `
                 -pipelinename $workflowName `
-                -imageName "" `
+                -imageName $imageName `
                 -memoryLimit $settings.memoryLimit `

Configuration

The existing AL-Go default remains unchanged:

{
  "cacheImageName": "my"
}

Users who want to retain the current local development behavior can disable cached image creation in .AL-Go/localDevEnv.settings.json:

{
  "cacheImageName": ""
}

Expected behavior

  • Local development environments use the configured cacheImageName.
  • With the default value my, BcContainerHelper creates or reuses an artifact-specific image.
  • When a matching image already exists, container creation does not repeat the Business Central installation from artifacts.
  • Setting cacheImageName to an empty string preserves the current behavior.
  • Cloud development environment behavior remains unchanged.

✅ Checklist

  • Update RELEASENOTES.md

frottke added 3 commits July 15, 2026 17:34
Added note about local development environments using cacheImageName for artifact-specific image reuse.
Copilot AI review requested due to automatic review settings July 22, 2026 15:53
@frottke
frottke requested a review from a team as a code owner July 22, 2026 15:53

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

Uses cacheImageName for faster local development container creation.

Changes:

  • Passes the configured image name for local environments.
  • Keeps cloud behavior unchanged.
  • Documents the behavior in release notes.

Reviewed changes

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

File Description
Actions/AL-Go-Helper.ps1 Forwards cacheImageName to local pipelines.
RELEASENOTES.md Documents cached local images and opt-out.

Comment thread Actions/AL-Go-Helper.ps1
Comment on lines +1828 to +1831
$imageName = ""
if ($kind -eq "local") {
$imageName = $settings.cacheImageName
}
Comment thread Actions/AL-Go-Helper.ps1
Comment on lines +1829 to +1830
if ($kind -eq "local") {
$imageName = $settings.cacheImageName
Comment thread Actions/AL-Go-Helper.ps1

$imageName = ""
if ($kind -eq "local") {
$imageName = $settings.cacheImageName
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