Skip to content

Add Azure Container Apps Jobs telemetry and managed identity support - #78

Merged
mathieumack merged 2 commits into
mainfrom
copilot/add-azure-container-apps-jobs-support
Sep 9, 2026
Merged

mathieumack merged 2 commits into
mainfrom
copilot/add-azure-container-apps-jobs-support

Conversation

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Azure Container Apps Jobs need standalone observability and identity support without ASP.NET Core or Dapr dependencies. Short-lived workloads must also flush final telemetry during graceful shutdown.

  • Dedicated Jobs package

    • Adds MDev.Dotnet.Azure.ContainerApps.Jobs.
    • Provides additive console and OpenTelemetry registration without clearing consumer providers.
    • Exports logs, traces, and metrics through Azure Monitor.
  • Reliable shutdown

    • Flushes all telemetry providers from ApplicationStopped.
    • Enforces a configurable timeout.
    • Preserves the job’s exception and exit code if export fails.
  • Managed identity

    • Selects the user-assigned identity from AZURE_CLIENT_ID.
    • Falls back to the system-assigned identity.
    • Rejects malformed configuration without exposing secrets.
  • Coverage and guidance

    • Adds configuration, provider composition, identity, and shutdown-export tests.
    • Documents worker lifecycle, cancellation, local development, and Azure deployment.
var builder = Host.CreateApplicationBuilder(args);

builder.Services.AddContainerAppJob(
    builder.Configuration,
    options =>
    {
        options.ServiceName = "DocumentProcessingJob";
        options.EnableAzureMonitor = true;
        options.FlushTimeout = TimeSpan.FromSeconds(10);
    });

builder.Services.AddSingleton(
    builder.Configuration.GetManagedIdentity());

using var host = builder.Build();
await host.RunAsync();

Co-authored-by: mathieumack <12582537+mathieumack@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Azure Container Apps Jobs telemetry and managed identity Add Azure Container Apps Jobs telemetry and managed identity support Sep 9, 2026
Copilot AI requested a review from mathieumack September 9, 2026 12:31

@mathieumack mathieumack left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, need to test now

@mathieumack
mathieumack marked this pull request as ready for review September 9, 2026 20:27
@mathieumack
mathieumack merged commit e813f12 into main Sep 9, 2026
5 checks passed
@mathieumack
mathieumack deleted the copilot/add-azure-container-apps-jobs-support branch September 9, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants