microsoft / microsoft/aspire

Azure App Service publisher omits WithHttpHealthCheck path from generated site configuration

Open
#19,208 1 comment 0 reactions 0 assignees View on GitHub
area-deployment area-integrations triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Describe the bug

Publishing a project to an Azure App Service environment does not emit the health-check path configured with `WithHttpHealthCheck` into the generated `Microsoft.Web/sites` resource.

The generated website Bicep contains a `siteConfig` block, but it does not set `healthCheckPath`. A live deployment confirms that the application's `/health` endpoint responds successfully, so the omission is in the App Service publish model rather than the application.

The App Service deployment documentation states:

> App Service exposes one health check path per website. If you configure multiple probes, Aspire prefers the liveness probe and uses that path for the App Service health check.

https://aspire.dev/deployment/azure/app-service/

### Expected Behavior

For a resource configured with `WithHttpHealthCheck("/health")`, the generated App Service website should include:

```bicep
siteConfig: {
healthCheckPath: '/health'
}
```

### Steps To Reproduce

1. Create an Aspire AppHost with an Azure App Service environment and one project:

```csharp
var builder = DistributedApplication.CreateBuilder(args);

var environment = builder.AddAzureAppServiceEnvironment("appservice");

builder.AddProject("api")
.WithExternalHttpEndpoints()
.WithHttpHealthCheck("/health")
.WithComputeEnvironment(environment);

builder.Build().Run();
```

2. Publish deployment artifacts:

```bash
aspire publish --output-path ./artifacts
```

3. Open the generated website Bicep under `artifacts/api/` and inspect the `Microsoft.Web/sites` resource.

The `siteConfig` block does not contain `healthCheckPath`.

### Exceptions (if any)

None. Publishing and deployment complete successfully, but App Service health checks are not configured.

### Aspire doctor output

Reproduced with:

```text
Aspire CLI 13.5.0+0028557bee5d68bf5093b9a58501d714701c0da6
.NET SDK 10.0.302
```

### Anything else?

Relevant documentation:

- [Deploy to Azure App Service](https://aspire.dev/deployment/azure/app-service/) documents that Aspire uses the configured probe path for the App Service health check.
- [Aspire health checks](https://aspire.dev/fundamentals/health-checks/) documents `WithHttpHealthCheck("/health")` for project resources.
- [`aspire publish`](https://aspire.dev/reference/cli/commands/aspire-publish/) documents generation of deployment artifacts without requiring a live Azure deployment.

The same omission was observed for two separately published App Service project resources. Both deployed applications served `/health` successfully.

The documented App Service health-check behavior was also verified against the Aspire docs `release/13.5` source: [app-service.mdx](https://github.com/microsoft/aspire.dev/blob/75b6e80016007c6f286808dca390b0abd04f9b05/src/frontend/src/content/docs/deployment/azure/app-service.mdx).

Contributor guide

Open the contributing guide

Research direction

Run `aspire publish --output-path ./artifacts` using the AppHost shown in the report, then inspect the generated `Microsoft.Web/sites` resource under `artifacts/api/`. Trace the Azure App Service publish model responsible for its `siteConfig` and compare it with the health-check behavior described in the linked documentation. Done means a resource configured with `WithHttpHealthCheck("/health")` emits `healthCheckPath: '/health'` in the generated website Bicep.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.