linguini-dev
03/30/2026, 2:47 PMazure.image does not work for me.
I want to delete all images older than 10 days.
I can use azure.armresource to get all the Image Definitions and I can use it to get all Image Versions. I correctly see them. However, azure.armresource doesn't scrape the properties of the objects, just the plain id,name,etc so I can't really combine / cross-reference the two.
Policy in question:
policies:
- name: get-image-definitions
resource: azure.armresource
filters:
- type: resource-type
values:
- Microsoft.Compute/galleries/images
- type: value
key: id
op: contains
value: "/galleries/mygallery/"
- name: get-image-versions
resource: azure.armresource
filters:
- type: resource-type
values:
- Microsoft.Compute/galleries/images/versions
- type: value
key: id
op: contains
value: "/galleries/mygallery/"
Is there any way to get all Versions of a particular Definition? Or to force the azure.armresource to pull the properties of the object as well ?
The properties key contains a key called publishedDate that I can use to wipe the images without caring which Definition they are a part of.linguini-dev
04/03/2026, 8:06 AMproperties are not being pulled on purpose or something like that?
I think having the properties returned makes sense for a lot of different object types and queries but I am not familiar enough with the inner-workings to understand if it can cause other problems / limitations.AJ Kerrigan
04/03/2026, 1:24 PMlinguini-dev
04/06/2026, 6:55 AMazurerm resource is a bit of a powerhouse, as you can use it for a variety of calls for different resources. But without pulling the properties , you can only manage those resources by tags or names, which IMO isn't all that useful for most of the resources*
Although it does make sense to just have a separate resource or filter than just azurerm for everything š
⢠YMMV depending on how you leverage tags.