ALOps Agent Maintenance
Cleanup and maintenance for DevOps agents running Business Central workloads. Supports Docker, BC Artifacts, package and temp caches, and old task cleanup with dry-run mode and disk metrics.
| Property |
Value |
| Task name (Azure DevOps) |
ALOpsAgentMaintenance@3 |
| Action name (GitHub) |
alops-agentmaintenance |
| Version |
3.0.0 |
| Category |
Utility |
| OS requirement |
Both |
| Preview |
yes |
Cleans up Docker resources (containers, images, volumes, build cache), BC Artifact caches, agent/Windows temp folders, package caches, and old ALOps task versions. Supports dry-run mode for previewing cleanup actions. Reports disk space freed and sets pipeline output variables for downstream steps.
docker
| Name |
Type |
Required |
Default |
Platform |
Description |
docker_containers |
Boolean |
no |
false |
Both |
Remove all stopped/exited Docker containers (docker container prune). |
docker_images |
Boolean |
no |
false |
Both |
Remove Docker images older than the specified number of days. |
prune_images_days_created |
Text |
no |
0 |
Both |
Remove Docker images older than this many days. Set to 0 to skip age-based image pruning. (Only applies when 'Prune Docker Images by Age' is enabled.) |
docker_images_by_os |
Boolean |
no |
false |
Both |
Remove Docker images whose OS version does not match the host OS. Uses direct Docker inspect (no BcContainerHelper dependency). Primarily relevant for Windows containers. |
docker_volumes |
Boolean |
no |
false |
Both |
Remove all dangling (unused) Docker volumes. |
docker_build_cache |
Boolean |
no |
false |
Both |
Remove all Docker build cache (docker builder prune). |
artifacts
| Name |
Type |
Required |
Default |
Platform |
Description |
bc_artifacts |
Boolean |
no |
false |
Both |
Remove unused BC Artifact cache folders, orphaned VSIX extractions, temp folders, and empty directories. |
bc_artifacts_cache_folder |
Text |
no |
(empty) |
Both |
Path to the BC Artifacts cache folder. Leave empty for auto-detection (checks bcaboragentartifactspath env var, then falls back to a platform default). (Only applies when 'Clean BC Artifacts Cache' is enabled.) |
package_cache |
Boolean |
no |
false |
Both |
Remove old ALTool/compiler packages from the agent tools directory and old NuGet global cache packages. |
agent
| Name |
Type |
Required |
Default |
Platform |
Description |
old_tasks |
Boolean |
no |
false |
Both |
Remove old ALOps task version folders from the agent. Auto-detects the current version and removes all older versions. (Azure DevOps agents only.) |
agent_temp |
Boolean |
no |
false |
Both |
Remove old files and folders from the agent temp directory (AGENT_TEMPDIRECTORY / RUNNER_TEMP). |
windows_temp |
Boolean |
no |
false |
Both |
Remove old files and folders from the Windows temp directory (TEMP). Windows agents only; no-ops on other platforms. |
advanced
| Name |
Type |
Required |
Default |
Platform |
Description |
days_unused |
Text |
no |
30 |
Both |
Threshold in days for cleanup operations. Items not used within this period are removed. Applies to BC Artifacts, Agent Temp, Windows Temp, and Package Cache operations. |
dry_run |
Boolean |
no |
false |
Both |
When enabled, reports what would be cleaned without actually deleting anything. Use this for change-management review before running actual cleanup. |
failure_action |
PickList |
no |
Warn |
Both |
How cleanup failures affect the task result. 'Error' fails the task on any cleanup error. 'Warn' logs warnings (SucceededWithIssues). 'Ignore' silently continues. Options: Error, Warn, Ignore. |
Outputs
| Name |
Description |
freed_bytes |
Total bytes freed across all operations. |
freed_mb |
Total megabytes freed across all operations. |
images_removed |
Number of Docker images removed. |
containers_removed |
Number of Docker containers removed. |
artifacts_removed |
Number of BC artifact cache items removed. |
operations_failed |
Number of cleanup operations that reported errors. |
dry_run |
Whether the task ran in dry-run mode (no deletions). |
Usage