microsoft / microsoft/aspire

Kusto emulator health check fails on MacOS

Open
#11,636 5 comments 0 reactions 0 assignees View on GitHub
area-integrations azure
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

```C#
var kde = builder.AddAzureKustoCluster("kusto").RunAsEmulator()
.AddReadWriteDatabase("My95App");

var apiService = builder.AddProject("apiservice")
.WithHttpHealthCheck("/health")
.WithReference(kde);
```

**Bug Summary:**
The Kusto emulator health check consistently fails to report healthy status when running on MacOS.

**Details:**
- Exception stack trace:

```
Kusto.Data.Exceptions.KustoClientException: Kusto client failed to send a request to the service: 'The response ended prematurely. (ResponseEnded)'.
Error details:
DataSource='http://localhost:56702/v1/rest/mgmt',
DatabaseName='NetDefaultDB',
ClientRequestId='KD2RunCommand;9a07dd9e-fad8-4b7b-add7-6a5f6df78307',
Timestamp='2025-09-24T14:14:20.8556640Z'.
System.Net.Http.HttpIOException: The response ended prematurely. (ResponseEnded)
at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Kusto.Data.Net.Client.RestClient2.MakeHttpRequestAsyncImpl(...)
at Aspire.Hosting.Azure.Kusto.AzureKustoHealthCheck.CheckClusterHealthAsync() in /_/src/Aspire.Hosting.Azure.Kusto/AzureKustoHealthCheck.cs:line 50
at Aspire.Hosting.Azure.Kusto.AzureKustoHealthCheck.CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken) in /_/src/Aspire.Hosting.Azure.Kusto/AzureKustoHealthCheck.cs:line 33
```

**Steps to Reproduce:**
1. Run Aspire project with Kusto emulator on MacOS.
2. Observe health check status (never goes healthy).

**Expected Behavior:**
Kusto emulator should pass the health check if the emulator is running and accessible on MacOS.

**Environment:**
- MacOS
- Please add your .NET SDK/runtime version

**Additional Information:**
- Health check code: `src/Aspire.Hosting.Azure.Kusto/AzureKustoHealthCheck.cs`
- Emulator setup code: `src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs`
- Functional tests: `tests/Aspire.Hosting.Azure.Kusto.Tests/KustoFunctionalTests.cs`
- Emulator container image: `src/Aspire.Hosting.Azure.Kusto/AzureKustoEmulatorContainerImageTags.cs`

If more details are needed, let me know!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.