withPurgeTask

Method
📦 Aspire.Hosting.Azure.ContainerRegistry v17.0.0
interface AzureContainerRegistryResource {
// ... omitted for brevity
withPurgeTask(
schedule: string,
filter?: string,
ago?: timespan,
keep?: number,
taskName?: string): AzureContainerRegistryResource;
}

Signature

methodwithPurgeTaskbuilder
Adds a scheduled ACR purge task to remove image tags and eligible untagged manifests.
withPurgeTask(
schedule: string,
filter?: string,
ago?: timespan,
keep?: number,
taskName?: string): AzureContainerRegistryResource
schedulestringThe cron schedule for the purge task timer trigger. Must be a five-part cron expression (`minute hour day-of-month month day-of-week`); seconds are not supported.
filterstringoptionalAn optional filter for the `acr purge --filter` parameter. Only repositories matching this filter will be purged. Defaults to `".*:.*"` (all repositories and tags) when `null`.
agotimespanoptionalThe age threshold based on last modified time, in milliseconds. Older matching tags are eligible for removal unless protected by the keep limit. Defaults to zero.
keepnumberoptional= 3The minimum number of newest matching tags to retain per repository, regardless of age. Must be greater than zero. Defaults to 3.
taskNamestringoptionalAn optional name for the ACR task resource. If not provided, a name is auto-generated based on existing purge tasks to avoid conflicts. If a task with the specified name already exists, an `ArgumentException` is thrown.
AzureContainerRegistryResource

Applies to

This method applies to the following types: