[BUG] Log Ingestion returns 204 but no logs written
See original GitHub issueLibrary name and version
Azure.Monitor.Ingestion 1.0.0
Describe the bug
I am using the new package to try to write logs to a data collection endpoint. I get a response of 204 but no logs are ever written to my custom log.
Expected behavior
I expect the logs to be written to the destination (Log Analytics Workspace) under the Custom Table I created
Actual behavior
I get a 204 response, but the logs are never written. Below is an output that is logged: Azure.Core: Information: Request [b38813bf-7ffa-45cf-9aa1-c5c871fea934] POST https://dce-statusnow-prd-easg.eastus-1.ingest.monitor.azure.com/dataCollectionRules/dcr-8ba104057eaa4ceb90bcae74d6af1a18/streams/Custom-UsageLogs_CL?api-version=2023-01-01 Accept:application/json x-ms-client-request-id:b38813bf-7ffa-45cf-9aa1-c5c871fea934 x-ms-return-client-request-id:true User-Agent:azsdk-net-Monitor.Ingestion/1.0.0 (.NET 7.0.2; Microsoft Windows 10.0.22621) Authorization:Bearer [Removed] Content-Type:application/json Content-Encoding:REDACTED client assembly: Azure.Monitor.Ingestion
Also the request/response from Fiddler: Request POST https://dce-statusnow-prd-easg.eastus-1.ingest.monitor.azure.com/dataCollectionRules/dcr-8ba104057eaa4ceb90bcae74d6af1a18/streams/Custom-UsageLogs_CL?api-version=2023-01-01 HTTP/1.1 Host: dce-statusnow-prd-easg.eastus-1.ingest.monitor.azure.com Accept: application/json x-ms-client-request-id: 88ad951d-b300-48f5-84bf-78aa3d578bbe x-ms-return-client-request-id: true User-Agent: azsdk-net-Monitor.Ingestion/1.0.0 (.NET 7.0.2; Microsoft Windows 10.0.22621) Authorization: Bearer traceparent: 00-2f072f70504932658151569a0c974518-2e32054aa06e01ae-00 Content-Type: application/json Content-Length: 69
{“ActionName”:“Global Search”,“UserEmail”:“sscowden@asmgroupinc.com”}
Response HTTP/1.1 204 No Content Server: Microsoft-HTTPAPI/2.0 Strict-Transport-Security: max-age=31536000; includeSubDomains; preload x-ms-request-id: b9e2a0a1-9112-411a-aff1-e8c0f74a3a5b X-Content-Type-Options: nosniff x-ms-client-request-id: 88ad951d-b300-48f5-84bf-78aa3d578bbe Date: Wed, 01 Mar 2023 19:23:08 GMT
Reproduction Steps
var data = new AzureLogUsageMessage()
{
ActionName = actionName,
UserEmail = userResolverService.GetEmail()
};
var response = await logsIngestionClient.UploadAsync(RuleId, StreamName, RequestContent.Create(data)).ConfigureAwait(false);
Environment
.NET SDK: Version: 7.0.102 Commit: 4bbdd14480
Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.102\
Issue Analytics
- State:
- Created 7 months ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
@scowdenconsulting I was recently struggling with this behavior as well, solution was to send everything as a JSON array by enclosing our JSON data in Square Brackets.
Unfortunately, not yet. They replied initially asking for more information but I haven’t heard back yet. I replied yesterday asking for an update. Will update this thread when they do get back to me.