Hi,
I’ve got some issues with broken icons for AVD remote applications that I’m trying to fix, one suggested fix is using AzAPI, I’ve got 28 applications that I need a for_each loop to run on to update the app description based on another article I’ve seen.
I want to run a for_each article like the below but I’m getting an error which is also noted below
Code:
resource "azapi_update_resource" "update_app_description" {
for_each = azurerm_virtual_desktop_application.*.id
type = "Microsoft.DesktopVirtualization/applicationGroups/applications@2023-09-05"
resource_id = each.value
body = {
properties = {
description = "Remote App"
}
}
}
Error:
│ on app.tf line 374, in resource “azapi_update_resource” “update_app_description”:
│ 374: resource_id = azurerm_virtual_desktop_application.*.id
│
│ A reference to a resource type must be followed by at least one attribute
│ access, specifying the resource name.
What’s the correct way of doing this or is there a better way around it?