microsoft / microsoft/aspire

Add support for Azure Container App Environment with other logging destinations

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

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I'm trying to use Azure Container App Environments without using Log Analytics. Azure Container Apps previously required Log Analytics, but this is no longer the case. `az containerapp env create` allows setting the argument `--logs-destination` with `azure-monitor`, `log-analytics`, and `none`. Using `AddAzureContainerAppEnvironment` it's possible to assign a custom configuration of Log Analytics. Not supplying a configuration, Log Analytics will be created by default. I succeeded in changing the configuration to `azure-monitor`, but the Log Analytics resource is still created:

```csharp
var acaEnv = builder.AddAzureContainerAppEnvironment("cniweb")
.ConfigureInfrastructure(infra =>
{
// Switch app log routing from log-analytics to azure-monitor.
// Diagnostic settings below then archive those logs to Azure Storage.
var env = infra.GetProvisionableResources()
.OfType()
.Single();

env.AppLogsConfiguration = new()
{
Destination = "azure-monitor"
};
});
```

### Describe the solution you'd like

When using `AddAzureContainerAppEnvironment`, it should be possible to specify the log destination, such as `WithDiagnostics`, or `WithLogDestination`.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at AddAzureContainerAppEnvironment and inspect how ConfigureInfrastructure exposes ContainerAppManagedEnvironment and its AppLogsConfiguration. Trace the default Log Analytics resource creation and determine how a log destination such as azure-monitor or none should be specified. Done means the requested destination can be selected without creating an unnecessary Log Analytics resource, with coverage for the supported destinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
cloud, infrastructure
Issue type
Feature
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.