if you have 5 function apps that are already created, then you should pull your data and iterate for each to do the entire association.
This is an example of how I would do it if I were to create a list of 1-2-3-4-5-6 or 110 function apps. where linux_app_name is the list of names -> type (list) , the reason why I did it in a local is because I'm checking before to see if it's empty or not. then for each app service id , doing the azurerm linux function app each key.id and of course the subnet that you're interested in.
Ensure you're putting the correct format of each value in the resource block. This serves purely as an example:
resource "azurerm_app_service_virtual_network_swift_connection" "funclinux" {
for_each = toset(local.linux_app_name)
app_service_id = azurerm_linux_function_app.linuxfunction[each.key].id
subnet_id = subnetid
}