Hello Pravin Patel, You tried to update an Azure Monitor Data Collection Rule (DCR) with a transformKql query in the dataFlows section. The error you received was: Code: Data flows containing stream groups cannot have custom transformation. This happened because you attempted to apply a transformation to the default stream group (Microsoft-ContainerInsights-Group-Default).
Many AKS/Container Insights DCRs created by the portal/extension are solution‑managed (effectively read‑only for some sections). You can usually update destinations, but adding transforms to a dataFlow that references a streamGroup isn’t allowed. If the DCR is solution‑managed, the clean path is to clone to a custom DCR and re‑associate it to the AKS cluster.
“Replace the stream group with the individual stream Microsoft-ContainerInsights-ContainerLogV2?” Yes, that is the supported pattern for transformations. Put the exact individual stream(s) you want under streams (not streamGroups) and then add transformKql.
Since you're considering replacing the stream group with Microsoft-ContainerInsights-ContainerLogV2, that is the right approach! You can definitely modify your DCR to specify individual streams instead of using the default group.
To proceed, you might want to:
- Remove the Stream Group: Update your DCR to include the individual streams where you want to apply your transformations.
- Update the KQL Query: Make sure your transformation query is accurately targeting the fields you want to process.
Here's a sample command structure you can try:
az monitor data-collection rule update --name <Your-DCR-Name> --resource-group <Your-Resource-Group> --set "dataFlows[0].streams=['Microsoft-ContainerInsights-ContainerLogV2']" --set "dataFlows[0].transformKql='source | project-away TenantId, LogSource, Type, _ResourceId'"
If you still face any issue, please help us with the below details.
- Have you already attempted to edit the data flow to include only the individual streams?
- Are there any specific logs or data types you're particularly interested in transforming?
- Could you provide the current complete configuration of your DCR related to the data flows?
Reference document:
Data collection rules in Azure Monitor - Azure Monitor | Microsoft Learn
Create a transformation in Azure Monitor - Azure Monitor | Microsoft Learn
Transformations Azure Monitor - Azure Monitor | Microsoft Learn
Monitor DCR data collection in Azure Monitor - Azure Monitor | Microsoft Learn
Hope this helps. Thanks.