GitHub Copilot Customization Explained for Beginners: Instructions, Prompt Files, Skills, Agents, and Hooks  Introduction If you've recently started using GitHub Copilot, you've probably come across terms like Instructions , Prompt Files , Skills , Agents , and Hooks . At first glance, they all seem to do the same thing—they tell Copilot what to do. So why does GitHub have five different customization features? The answer is simple: each feature solves a different problem. Think of GitHub Copilot as a new developer joining your team. On their first day, you don't just hand them code. You explain your coding standards, give them reusable templates, teach them specialized knowledge, assign them a role, and automate repetitive tasks. That's exactly how GitHub Copilot customization works. In this article, you'll learn what each feature does, when to use it, and how they all work together. By the end, you'll know which feature to start with and which ones can wait un...

Cleaning Azure Container Registry (ACR) on demand or schedule


In this blog post, we will see how to purge container images from Azure Container Registry (ACR). Till recent time most of them would have written custom PowerShell or bash script and run it to clean (purge) ACR container images. Recently Microsoft introduced a new preview feature to automatically purge images based on filters, duration, and untagged manifests. Additionally, this new preview feature supports to run on-demand or on a schedule using CRON expression.

In my current project, our delivery team is committing code several times a day. This automatically triggers a CI pipeline from which images are automatically built and pushed into ACR. Most of them would be going through the same journey. In this situation using this new preview feature, helps to keep ACR clean and not worrying about the Container registry getting bloated with images. 

Both on-demand or schedule will make use of acr purge command. ACR purge is designed to run as a container command in an ACR Task internally it authenticates automatically with the registry where the task runs and performs actions there. Purge command options and capabilities are defined here.

Note: Use the ACR purge command with caution--deleted image data is UNRECOVERABLE. 

On-Demand Task

On-demand task as the name says if you want to run on-demand or ad-hoc basis to purge container images based on the filter criteria defined.

On-Demand Task

Scheduled Task

Using the ACR purge command we can also schedule the purge to run automatically on a specific schedule. This is based on running ACR tasks. Schedule parameter in the below command is defined in Cron expressions format and you can read more about them at https://docs.microsoft.com/en-us/azure/container-registry/container-registry-tasks-scheduled#cron-expressions.
Scheduled Task 

View the list of Scheduled Task 

az acr task list -r <ACR Registry Name> -o table

List of Tasks

Delete the Scheduled Task

az acr task delete --name <Task Name> --registry <ACR Registry Name>

Delete Task


References:

Comments

Popular posts from this blog

Tidy up - Unused Project and Nuget package reference using Visual Studio 2019

Azure Front Door vs Azure Traffic Manager?

Authenticate Azure Functions - API Keys