Public documentation
Documentation indexRead as MarkdownAzure: Container Apps API
Deploy an instrumented API in Azure Container Apps and export traces to Corridora over OTLP/HTTP. Serve the RUM-enabled frontend through your existing Static Web Apps, Storage, or Front Door setup, with an API route that reaches the container.
This recipe uses direct application export. Azure Monitor collection and platform request identifiers do not automatically supply Corridora with matching spans.
Prerequisites
- An existing Container App with working ingress and a target port matching the application; examples use 8080.
- An instrumented image and registry access. Build the trace-check API or use a language guide and Docker setup.
- Azure CLI access to the intended subscription, with permission to update the app and its secrets.
- A backend Corridora ingest key, plus a separate RUM key for the frontend in the same organization.
- Network egress from the app to the Corridora ingest endpoint over HTTPS.
Preserve existing ingress, managed identities, application authentication, probes, and scaling configuration. For a multi-container app, target the intended application container rather than changing a sidecar's exporter settings.
Define the secret
Create an application secret named otel-headers in the Container App's Secrets configuration. Its value is the entire header assignment:
X-CORRIDORA-KEY=YOUR_BACKEND_INGEST_KEY
Alternatively, use an existing Key Vault-backed secret reference with the app's configured managed identity and secret-read permission. The exporter receives the resolved header value; it cannot use a Key Vault URL as the ingest credential.
App-level secret changes do not themselves create a revision or refresh every existing process. After rotation, deploy a new revision or restart the affected revision. Scope access to secret-management operations carefully because some Azure roles can read the secret values.
Update application configuration
Set these names for the intended existing app:
export AZURE_RESOURCE_GROUP=YOUR_RESOURCE_GROUP
export CONTAINER_APP=shop-api
export IMAGE=YOUR_REGISTRY/shop-api:YOUR_RELEASE
export RELEASE=YOUR_RELEASE
az containerapp update \
--name "$CONTAINER_APP" --resource-group "$AZURE_RESOURCE_GROUP" \
--image "$IMAGE" \
--set-env-vars \
APP_ORIGIN=https://www.example.com \
OTEL_SERVICE_NAME=shop-api-azure \
"OTEL_RESOURCE_ATTRIBUTES=service.namespace=commerce,deployment.environment.name=production,service.version=$RELEASE" \
OTEL_TRACES_EXPORTER=otlp \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORTER=none \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.corridora.ai \
OTEL_EXPORTER_OTLP_HEADERS=secretref:otel-headers \
OTEL_PROPAGATORS=tracecontext,baggage \
OTEL_TRACES_SAMPLER=parentbased_always_on
--set-env-vars adds or updates the listed settings and preserves unrelated variables. The secretref: value instructs Azure to inject the application secret. Use your installation's ingest endpoint if different.
The image must contain and start its SDK or agent before application modules load. These environment variables configure an exporter; they do not add instrumentation to an otherwise uninstrumented app. Follow the language guide if its SDK configures an option in code.
Verify the new revision is healthy, then direct the intended traffic to it using your existing revision rollout process. In multiple-revision mode, successful configuration does not imply that all traffic moved. Integrate SDK shutdown with graceful container termination.
Configure Front Door and RUM
For the Front Door API route, disable caching and preserve the incoming traceparent through rules and origin forwarding. Retain the origin's CORS response. Static assets can keep their separate cache policy.
Install browser RUM in the frontend template. Same-origin /api/* fetches are eligible for trace injection automatically. For a separate API origin, set the exact HTTPS origin in data-trace-origins and allow traceparent in API preflights.
Your WAF, access controls, and API authentication must permit the intended request and its preflight. A trace ID is diagnostic context, not an authorization credential. Keep the backend ingest key server-side; only the dedicated RUM key belongs in the page.
Verify the deployment
- Confirm the expected image/revision handles the request.
- Check startup and exporter logs for invalid configuration, missing secrets, or HTTPS failures.
- Issue an uncached browser API request and confirm W3C context reaches the application.
- Find the browser CLIENT and backend SERVER spans with matching trace IDs in Corridora, using verification.
- Repeat through Front Door and directly through your authorized origin test path to isolate header or caching problems.
If the first request works but later traces are absent, test lifecycle flushing and secret updates on all active revisions. The response's trace ID proves context extraction, while a visible Corridora span proves export and ingestion.
Azure's managed Container Apps OpenTelemetry agent is a separate collection path with its own supported protocol and routing configuration. Do not replace the HTTP endpoint above with a managed-agent address without configuring its receiver and Corridora destination. For AKS, use the Kubernetes guide.