Manage apps
An app represents a workload inside a Diagrid project. Think of it like a username and password pair: the app's name identifies your workload, and its API token authenticates every Dapr API call it makes to Diagrid. Each app also optionally configures how Diagrid routes traffic back to your app — pub/sub messages, input bindings, service invocations, actor invocations, and health checks.
Whether you're running a workflow, a durable agent, or a microservice, each workload runs as an app for identity, connectivity, and component scoping. The Connect to Diagrid guide walks through how apps fit into the broader connection model.
Every operation on this page — creating apps, configuring app connections, health checks, body-size limits, and deleting — can also be done from the Diagrid Web Console at catalyst.diagrid.io.
What an app provides
Each app exposes:
- API token — a bearer token used by your application to authenticate every Dapr API call to Diagrid.
- App connection (optional) — how Diagrid reaches your application for inbound requests, via a reachable endpoint URL, a private tunnel, or streamed to the terminal.
- Health checks — optional HTTP health probes against your application, with configurable path, interval, timeout, and failure threshold.
- Runtime configuration — body-size limits, app protocol (HTTP or gRPC), channel timeouts, and an optional application token for securing callbacks.
- Component scope — the set of components (state stores, pub/subs, bindings, etc.) that this app can use.
Create an app
# App without a reachable endpoint — for apps that run no server and only call Diagrid APIs (e.g., workflow workers and clients)
diagrid app create my-app --project my-project --wait
# App with a reachable app endpoint and an application token for callbacks
diagrid app create my-subscriber \
--project my-project \
--endpoint https://myapp.myorg.com/ \
--endpoint-token xxxxxxxx \
--wait
# App with a custom health check
diagrid app create my-api \
--endpoint https://myendpoint.io \
--endpoint-protocol http \
--enable-app-health-check=true \
--app-health-check-path "/healthz" \
--app-health-probe-interval 5 \
--app-health-probe-timeout 500 \
--app-health-threshold 5 \
--wait
# App with an increased max body size (default is the project-level value)
diagrid app create my-large-payload-app --max-body-size 8Mi --wait
See diagrid app create for the complete list of flags.
Connection options
When Diagrid needs to call your application (to deliver a pub/sub message, fire an input binding, respond to a service invocation, or invoke an actor), it routes the request through the app connection. Choose the option that matches where your app runs — a reachable URL for production, a tunnel for local development, or streaming to your terminal for inspection:
| Option | Use when | CLI |
|---|---|---|
| Connect to app endpoint | Your app is reachable over the network (public HTTPS, private endpoint). | Set --endpoint on diagrid app create / update. |
| Connect via private tunnel | You are running the app locally for development. | diagrid dev run --id my-app --app-port 9001 |
| Connect to terminal | You want to inspect inbound traffic without running app code. | diagrid listen --id my-app |
See Connect for Dev/Test for the full local-development workflow.
When to leave the app connection unset
Only set an app connection if your app runs a server that Diagrid needs to call. That's the case when your app receives pub/sub messages, input bindings, or service invocations, or hosts actors through app callbacks. If your app doesn't run a server, leave the connection unset. A workflow worker, for example, pulls its work from Diagrid over gRPC, so it needs no connection. Neither does an app that only publishes messages, saves state, or calls other apps.
Diagrid always health-checks the tunnel that diagrid dev run --app-port opens. It health-checks an app endpoint only when the app health check is turned on. If nothing answers, Diagrid marks the app unhealthy and holds back workflows, actors, and message delivery to it until it answers. Starting a workflow then fails with failed to create workflow instance: context canceled. To run a workflow-only worker locally, use diagrid dev run without --app-port.
Secure the application connection
When you configure a reachable app endpoint, secure the callback with an application token so only Diagrid can call your app:
diagrid app update my-subscriber \
--endpoint-token "$(openssl rand -hex 32)"
See diagrid app update for all updatable fields. Diagrid includes the token in the dapr-api-token HTTP header (or gRPC metadata) for every request it makes to your application. Validate the token in your app code and reject any request that doesn't carry it.
For production deployments, pair the application token with network-level allowlisting using the project's egress address so that only Diagrid can route traffic to your app.
Health checks
Diagrid can monitor your application's health and stop routing traffic to unhealthy instances:
diagrid app update my-api \
--enable-app-health-check=true \
--app-health-check-path "/healthz" \
--app-health-probe-interval 5 \
--app-health-probe-timeout 500 \
--app-health-threshold 3
--app-health-probe-intervalcontrols how often (in seconds) Diagrid probes the endpoint.--app-health-probe-timeoutsets the probe timeout in milliseconds.--app-health-thresholdis the number of consecutive failures before the app is considered unhealthy.
Body-size and channel limits
Each app inherits project-level limits for request body size and channel timeout. Override them per app when a workload has different requirements:
diagrid app update my-upload-api \
--max-body-size 16Mi \
--app-channel-timeout-seconds 120
Apps default to a 4Mi maximum body size. See Plans & support for the request-rate limits of each plan.
Inspect apps
# List all apps in the active project
diagrid app list
# Get details for a specific app, including its API token and endpoints
diagrid app get my-app
# Stream logs from the app's Dapr runtime
diagrid app logs my-app --follow
See diagrid app list, diagrid app get, and diagrid app logs. The logs command streams Dapr runtime logs from the Diagrid data plane so you can debug startup errors, component binding failures, and callback issues without leaving the terminal.
Update and delete apps
# Edit an app's specification in your editor
diagrid app edit my-app
# Update a specific field
diagrid app update my-app --endpoint https://my-new-endpoint/
# Delete an app (this removes its API token and all component bindings)
diagrid app delete my-app --wait
See diagrid app edit, diagrid app update, and diagrid app delete.
Use with workflows, agents, and distributed apps
- Workflows — each workflow execution authenticates with an app's API token when calling the Workflow API. See Develop Durable Workflows.
- Agents — agents leverage Dapr APIs for state, pub/sub, and service invocation. See Develop Agents.
- Distributed applications — each microservice gets its own app, and services invoke one another by app name through the Service Invocation API. See the Dapr APIs guide.
External apps
By default, Diagrid hosts the Dapr sidecar for each app, and your app calls it over the network. An external app is for when you want to host the sidecar yourself, outside the Diagrid platform, for example on the same compute as your app. The sidecar connects to Diagrid on its own, and your app calls Dapr on localhost. This is the local Dapr server location.
Choose it when the sidecar must stay inside your network boundary or run next to your app. Otherwise keep the default: Diagrid hosts the sidecar and you operate nothing.
Mark an app as external when you create it. You cannot change it afterwards, so to switch an existing app, delete it and create it again.
diagrid app create orders --external
Or declaratively:
apiVersion: cra.diagrid.io/v1beta1
kind: AppIdentity
metadata:
name: orders
spec:
external: true
If diagrid app create --external reports that external apps are not supported yet, it has not created the app. Run diagrid appid create orders --external instead.
Run the sidecar yourself
An external app's sidecar is a container image that you run next to your app. It needs three things:
- A bootstrap config from Diagrid. It tells the sidecar who it is and how to reach Diagrid.
- A certificate authority (CA) that you own. The sidecar uses it to issue its own certificates.
- Network access from the sidecar to Diagrid, and between the sidecar and your app on
localhost.
The steps below run the sidecar with Docker on the same host as an app called orders that listens on port 8080. Adapt them to however you run containers, for example a sidecar container in a Kubernetes pod or a systemd service.
1. Create the app
Create the app as external, and point its endpoint at the port your app listens on. The sidecar calls your app at that address to deliver pub/sub messages, service invocations and other inbound requests:
diagrid app create orders --external --endpoint http://localhost:8080 --wait
Skip --endpoint if your app only calls Dapr APIs and never receives calls.
2. Save the bootstrap config
Once the app is ready, Diagrid generates its bootstrap config. Save it to a file:
mkdir -p sidecar-config
diagrid app get orders -o json \
| jq -r '.status.appIds[0].status.externalBootstrapConfig' > sidecar-config/bootstrap.yaml
diagrid app get orders also shows it under External Bootstrap Config. The bootstrap config contains a token that lets the sidecar join your project. Treat it as a secret: store it in a secret manager, and do not print it into logs or commit it.
3. Create a certificate authority
The sidecar issues its own workload certificates from a CA that you provide: a root certificate and an intermediate (issuer) certificate signed by it. Use your existing PKI, or create one with OpenSSL:
cd sidecar-config
# Root CA
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out root-key.pem
openssl req -x509 -new -key root-key.pem -sha256 -days 3650 \
-subj "/CN=sidecar-root" -out trust-anchors.pem
# Issuer (intermediate) CA, signed by the root
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out issuer-key.pem
openssl req -new -key issuer-key.pem -subj "/CN=sidecar-issuer" -out issuer.csr
printf "basicConstraints=critical,CA:TRUE,pathlen:0\nkeyUsage=critical,keyCertSign,cRLSign\n" > issuer.ext
openssl x509 -req -in issuer.csr -CA trust-anchors.pem -CAkey root-key.pem -CAcreateserial \
-sha256 -days 365 -extfile issuer.ext -out issuer.pem
rm issuer.csr issuer.ext
cd ..
Keep root-key.pem and issuer-key.pem private. The sidecar only needs trust-anchors.pem, issuer.pem and issuer-key.pem, so store the root key somewhere else. Use the same CA for every external app that should call the others.
4. Start the sidecar
Mount the four files into the container and pass their paths in environment variables:
chmod 644 sidecar-config/bootstrap.yaml sidecar-config/trust-anchors.pem \
sidecar-config/issuer.pem sidecar-config/issuer-key.pem
docker run -d --name orders-sidecar --restart always --network host \
-v "$PWD/sidecar-config:/config:ro" \
-e BOOTSTRAP_CONFIG_PATH=/config/bootstrap.yaml \
-e WORKLOAD_IDENTITY_TRUST_ANCHORS=/config/trust-anchors.pem \
-e WORKLOAD_IDENTITY_ISSUER_CERT=/config/issuer.pem \
-e WORKLOAD_IDENTITY_ISSUER_KEY=/config/issuer-key.pem \
-e CATALYST_PROBES_PORT=39091 \
us-central1-docker.pkg.dev/prj-common-p-shared-79896/reg-p-common-docker-public/sidecar:1.56.0 \
/cra
The container runs as a non-root user, which is why the files must be readable by others. On a shared host, mount them from a directory only that container can reach, or use your platform's secret mounts.
| Variable | Required | What it is |
|---|---|---|
BOOTSTRAP_CONFIG_PATH | Yes | Path to the bootstrap config. |
WORKLOAD_IDENTITY_TRUST_ANCHORS | Yes | Path to your root CA certificate. |
WORKLOAD_IDENTITY_ISSUER_CERT | Yes | Path to your issuer certificate. |
WORKLOAD_IDENTITY_ISSUER_KEY | Yes | Path to your issuer private key. |
CATALYST_PROBES_PORT | No | Port of the sidecar's readiness endpoint, /ready. Defaults to 8080, so set it if your app uses 8080. |
METRICS_PORT | No | Port of the sidecar's own metrics. Defaults to 9091. |
DAPR_NAME_RESOLUTION_COMPONENT | No | Set to mdns so external sidecars on the same local network can find each other for service invocation. |
The sidecar listens on these ports:
| Port | Used for |
|---|---|
3500 | Dapr HTTP API, for your app |
50001 | Dapr gRPC API, for your app |
50002 | Calls from other sidecars (service invocation) |
9090 | Dapr metrics |
The sidecar needs outbound access to your Diagrid region. It is ready once GET http://localhost:39091/ready returns 200.
5. Point your app at the sidecar
Give your app the sidecar's address and the app's API token. Dapr SDKs read these environment variables:
export DAPR_HTTP_ENDPOINT=http://localhost:3500
export DAPR_GRPC_ENDPOINT=localhost:50001
export DAPR_API_TOKEN=$(diagrid app get orders -o json | jq -r '.status.apiToken')
Use the Kubernetes operator
If your apps run in your own Kubernetes cluster, the Diagrid Kubernetes Operator does all of the above for you. Annotate the workload with catalyst.diagrid.io/host: "local": the operator creates the external app, keeps its bootstrap config and a CA in a Kubernetes Secret, and adds the sidecar to your pod. See Run the Dapr server in your pods.
In a public region, an external app cannot use workflows or agent state, and its sidecar does not load the managed KV store or managed pub/sub. State store and pub/sub components you bring yourself still work. Dedicated Cloud, BYOC, and Enterprise Server regions have no such limit. See Dapr server location.
Declarative management
Apps can be managed declaratively with diagrid apply:
apiVersion: cra.diagrid.io/v1beta1
kind: AppIdentity
metadata:
name: my-app
spec:
appEndpoint:
url: https://myapp.myorg.com/
protocol: http
healthCheck:
path: /healthz
probe:
enabled: true
maxBodySize: 8Mi
diagrid apply -f my-app.yaml
See Declarative management for the full GitOps workflow, diagrid export patterns, and scoped API keys for CI.
What's next
- Components — wire backing infrastructure to apps.
- Connect to Diagrid — understand how apps fit into the overall connectivity model.
- Observability — inspect app metrics, logs, and API calls.