Please ensure that you follow this for the plan creation:
resource flexFuncPlan 'Microsoft.Web/serverfarms@2024-04-01' = {
name: planName
location: location
tags: tags
kind: 'functionapp'
sku: {
tier: 'FlexConsumption'
name: 'FC1'
}
properties: {
reserved: true
}
}
Here's a full example: https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/IaC/bicep/core/host/function.bicep