az monitor data-collection rule create with rule.json succeeds, but rule created is buggy. #7096
Labels
Auto-Assign
Auto assign by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
Connected Kubernetes
Monitor
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Describe the bug
In short, the created rule does not have the dataCollectionEndpointId passed in the json file.
Related command
az monitor data-collection rule create
Errors
The command succeeds, but the rule created is buggy (missing dataCollectionEndpointId)
Issue script & Debug output
$ cat dcr_temp.json
{
"location": "WestUS3",
"properties": {
"dataCollectionEndpointId": "/subscriptions/b09d4a2d-699b-4c76-8c7a-d97165a77a3b/resourceGroups/peluo_strato_test_rg1/providers/Microsoft.Insights/dataCollectionEndpoints/stratotmpdce",
"streamDeclarations": {
"Custom-peluotmptable_CL": {
"columns": [
{
"name": "Body",
"type": "string"
},
{
"name": "TimeGenerated",
"type": "datetime"
},
{
"name": "SeverityText",
"type": "string"
}
]
}
},
"dataSources": {},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "/subscriptions/b09d4a2d-699b-4c76-8c7a-d97165a77a3b/resourcegroups/peluo_strato_test_rg1/providers/microsoft.operationalinsights/workspaces/peluotmplaw",
"name": "peluotmplaw"
}
]
},
"dataFlows": [
{
"streams": [
"Custom-peluotmptable_CL"
],
"destinations": [
"peluotmplaw"
],
"transformKql": "source",
"outputStream": "Custom-peluotmptable_CL"
}
]
}
}
$ az monitor data-collection rule create --resource-group ${RESOURCE_GROUP} --location ${LOCATION} --name ${DCR_NAME} --rule-file ./dcr_temp.json
{
"dataCollectionEndpointId": null,
"dataFlows": [
{
"destinations": [
"peluotmplaw"
],
"outputStream": "Custom-peluotmptable_CL",
"streams": [
"Custom-peluotmptable_CL"
],
"transformKql": "source"
}
],
"dataSources": {
"extensions": null,
"iisLogs": null,
"logFiles": null,
"performanceCounters": null,
"syslog": null,
"windowsEventLogs": null
},
"description": null,
"destinations": {
"azureMonitorMetrics": null,
"logAnalytics": [
{
"name": "peluotmplaw",
"workspaceId": "f60bfccb-1813-4d94-aa20-d60010c10def",
"workspaceResourceId": "/subscriptions/b09d4a2d-699b-4c76-8c7a-d97165a77a3b/resourcegroups/peluo_strato_test_rg1/providers/microsoft.operationalinsights/workspaces/peluotmplaw"
}
]
},
"etag": ""00002713-0000-4d00-0000-658003ff0000"",
"id": "/subscriptions/b09d4a2d-699b-4c76-8c7a-d97165a77a3b/resourceGroups/peluo_strato_test_rg1/providers/Microsoft.Insights/dataCollectionRules/peluotmpdcr",
"immutableId": "dcr-a7f02ae4c25c468abb34d4e62fbbb08e",
"kind": null,
"location": "WestUS3",
"metadata": null,
"name": "peluotmpdcr",
"provisioningState": "Succeeded",
"resourceGroup": "peluo_strato_test_rg1",
"streamDeclarations": null,
"systemData": {
"createdAt": "2023-12-18T08:34:04.841708+00:00",
"createdBy": "",
"createdByType": "User",
"lastModifiedAt": "2023-12-18T08:34:04.841708+00:00",
"lastModifiedBy": "",
"lastModifiedByType": "User"
},
"tags": null,
"type": "Microsoft.Insights/dataCollectionRules"
}
Expected behavior
The rule created having the data collection endpoint.
Environment Summary
azure-cli 2.55.0
core 2.55.0
telemetry 1.1.0
Extensions:
connectedk8s 1.5.2
k8s-extension 1.5.2
monitor-control-service 0.4.1
Additional context
No response
The text was updated successfully, but these errors were encountered: