After a deeper investigation I have found that the reason for this error is due the policy enforcement that we deployed for tag compliance
So whenever we create a vnet flow logs with traffic analytics its internaly creating two new resources called dataCollectionEndpoints and dataCollectionRules. This resource is not having the proper tags which getting the cause of the entire flow log to fail .
Update
After i tried to pass the tags for vnet flow logs but still it getting failed this is because the tag that i passed during vnetflow logs is not inherited by the 2 resources (dataCollectionRules and dataCollectionEndpoints) so the only way this to work by updating the policy definition to allow these resources with specific naming pattern as the names always starts with NWTA-* i hope ms will not change this naming pattern in the backend :)
Sample Policy Def
{
"mode": "Indexed",
"policyRule": {
"if": {
"allOf": [
{
"anyOf": [
{
"allOf": [
{
"field": "type",
"in": [
"Microsoft.Insights/dataCollectionEndpoints",
"Microsoft.Insights/dataCollectionRules"
]
},
{
"field": "name",
"notContains": "NWTA-"
},
{
"field": "[concat('tags[', parameters('tagName'), ']')]",
"exists": "false"
}
]
},
{
"allOf": [
{
"field": "type",
"notIn": [
"Microsoft.Insights/dataCollectionEndpoints",
"Microsoft.Insights/dataCollectionRules"
]
},
{
"field": "[concat('tags[', parameters('tagName'), ']')]",
"exists": "false"
}
]
}
]
}
]
},
"then": {
"effect": "deny"
}
}