Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az monitor data-collection rule create with rule.json succeeds, but rule created is buggy. #7096

Closed
peienluo opened this issue Dec 18, 2023 · 3 comments · Fixed by #7120
Closed
Assignees
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

Comments

@peienluo
Copy link

peienluo commented Dec 18, 2023

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

@peienluo peienluo added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 18, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Connected Kubernetes Service Attention This issue is responsible by Azure service team. Monitor labels Dec 18, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 18, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 18, 2023

Thank you for opening this issue, we will look into it.

@yonzhan yonzhan added this to the Backlog milestone Dec 18, 2023
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 18, 2023
@AllyW AllyW removed the Service Attention This issue is responsible by Azure service team. label Dec 18, 2023
@AllyW
Copy link
Member

AllyW commented Dec 20, 2023

@peienluo for now, az monitor data-collection rule create does not support datacollectionendpointid now. and we are upgrading our code base to support it.

@hazcod
Copy link

hazcod commented Feb 1, 2024

@AllyW Sorry for commenting here, but i'm still unable to do so and az monitor data-collection rule association create returns Association cannot be created for resource of type Microsoft.Insights/dataCollectionEndpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
4 participants