Deployment guide

Dapr

Overview

Dapr (the Distributed Application Runtime) is a CNCF graduated project that gives microservices a set of portable, language-agnostic building block APIs over HTTP and gRPC. The blocks cover state management, publish and subscribe messaging, reliable service invocation, bindings, secrets, actors and workflow. An application talks to a co-located Dapr sidecar over loopback, so it gets these capabilities without hard-coding any specific message broker, database or cloud service.

This SecureAnyCloud image delivers a complete single-node, self-hosted Dapr runtime on Ubuntu 24.04 on Azure, fully installed and configured. It includes the daprd runtime and the dapr CLI, so you have a working Dapr environment answering within minutes of launch. Every part runs as a hardened systemd service that comes back automatically after a reboot.

Nothing secret is baked into the image. On the first boot of every instance, a unique Redis password is generated, written into the Redis configuration, rendered into the Dapr component definitions and saved to a root-only credentials file.

What you get:

  • Dapr runtime daprd 1.18.2, run under systemd (dapr-sidecar.service) as an unprivileged dapr user. It serves the building block APIs for the bundled demo app on 127.0.0.1:3500 (HTTP) and 127.0.0.1:50001 (gRPC)
  • The dapr CLI 1.18.1 at /usr/local/bin/dapr. The runtime and the CLI are installed from the official upstream release binaries, verified by SHA256
  • The Dapr placement service (dapr-placement.service) for actor placement, on loopback
  • A local Redis (redis-server.service) bound to 127.0.0.1:6379 with a per-instance password, wired as the default Dapr state store and pub/sub component (/etc/dapr/components/)
  • A bundled sample subscriber app (dapr-sample-app.service) on 127.0.0.1:8088 that subscribes to the orders topic. A state save and get round trip and a publish and subscribe message flow work end to end out of the box
  • A per-instance Redis password, generated fresh on first boot and written to /root/dapr-credentials.txt
  • A secure-by-default network posture. The Dapr HTTP API (port 3500), gRPC API (port 50001), the placement service and Redis are all bound to the loopback interface only and never exposed to the network. The only open port on the virtual machine is SSH, backed by a default-deny firewall

Prerequisites

  • An active Azure subscription, an SSH public key, and a VNet with a subnet in the target region
  • A subscription to the Dapr listing on Azure Marketplace
  • Network security group rules that allow TCP 22 (admin) only. Every Dapr and Redis endpoint is loopback and needs no inbound port

Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM). The Dapr runtime and placement service are compact Go binaries, and a single-node Redis fits comfortably. Choose a larger size for heavier workloads or a larger state store.

1

Deploy from the Azure Portal

Search the Azure Marketplace for Dapr, select the SecureAnyCloud publisher and click Create. Configure the network security group to allow TCP 22 for administration.

No other inbound port is required. Your microservices run alongside the Dapr sidecar on the same VM and reach it over loopback.

2

Deploy from the Azure CLI

RG="dapr-prod"; LOCATION="eastus"; VM_NAME="dapr1" IMAGE_URN="sac1647283583153:dapr-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION"
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:dapr-ubuntu-24-04:default:latest
az vm create \
  --resource-group "$RG" --name "$VM_NAME" \
  --image "$IMAGE_URN" \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values "$SSH_KEY" \
  --public-ip-sku Standard
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 22 --priority 1001
3

Verify the runtime, placement and Redis services

SSH in as azureuser. Confirm that the four services are active and enabled, so they survive a reboot, and that the pinned Dapr CLI and runtime versions are installed.

for s in redis-server dapr-placement dapr-sample-app dapr-sidecar; do printf '%-22s %s / %s\n' "$s" "$(systemctl is-active $s)" "$(systemctl is-enabled $s)" done dapr version | grep -i 'CLI version' /opt/dapr/bin/daprd --version | head -1

All four services report active / enabled. The CLI reports 1.18.1 and the runtime reports 1.18.2.

4

Save and read state through the Dapr state API

The bundled Dapr sidecar exposes the state building block on 127.0.0.1:3500 for the app id demo. Save a key and read it back. The value round-trips, and it is stored in Redis. Dapr prefixes keys with the app id, so the Redis key is demo||order1.

curl -s -X POST http://127.0.0.1:3500/v1.0/state/statestore \
  -H 'Content-Type: application/json' \
  -d '[{"key":"order1","value":"hello dapr"}]' echo "saved (HTTP 204)"
curl -s http://127.0.0.1:3500/v1.0/state/statestore/order1; echo REDIS_PASSWORD="$(sudo grep '^REDIS_PASSWORD=' /root/dapr-credentials.txt | cut -d= -f2-)" redis-cli -h 127.0.0.1 -p 6379 -a "$REDIS_PASSWORD" --no-auth-warning EXISTS 'demo||order1'

The GET returns "hello dapr", and the Redis EXISTS check returns 1, which proves that Redis backs the state.

5

Publish a message through the Dapr pub/sub API

The bundled sample app subscribes to the orders topic on the pubsub component. Publish a message through the Dapr pub/sub building block and watch it arrive at the subscriber:

curl -s -X POST http://127.0.0.1:3500/v1.0/publish/pubsub/orders \
  -H 'Content-Type: application/json' \
  -d '{"orderId":"order-42"}' echo "published (HTTP 204)" sleep 2
sudo tail -n 2 /var/lib/dapr/received.log

Dapr delivers the message to the subscribed app as a CloudEvent. The sample app records it in /var/lib/dapr/received.log.

6

Confirm the secure-by-default posture

Redis rejects unauthenticated access. Redis and the Dapr APIs listen on loopback only. The firewall is default-deny except for SSH, and the per-instance credentials file is readable by root only. Check each of these:

redis-cli -h 127.0.0.1 -p 6379 PING || true ss -ltn | grep -E ':6379|:3500|:50001|:50005' | awk '{print $1, $4}'
sudo ufw status | grep -E 'Status|22' stat -c '%n %a %U:%G' /root/dapr-credentials.txt

The unauthenticated PING is rejected with NOAUTH. Every Dapr and Redis socket is bound to 127.0.0.1, only SSH is allowed, and the credentials file is 600 root:root.

7

Add your own components and wire in your services

Dapr components live in /etc/dapr/components/. The image ships statestore.yaml and pubsub.yaml, both backed by the local Redis. To point your own microservice at Dapr, run it alongside a daprd sidecar and call the same building block APIs on 127.0.0.1:3500:

ls -l /etc/dapr/components/ cat /root/dapr-credentials.txt | sed -n '1,12p'

To add a component, such as a second state store, a binding or a secret store, drop a Dapr component YAML into /etc/dapr/components/ and restart the sidecar with sudo systemctl restart dapr-sidecar. See the Dapr components reference for the full catalogue.

Security notes

  • No shared credential ships in the image. The Redis password is generated per instance on first boot and written to /root/dapr-credentials.txt (readable by root only). Redis rejects unauthenticated access.
  • Everything binds to loopback. The Dapr HTTP API (3500), gRPC API (50001), placement (50005) and Redis (6379) listen on 127.0.0.1 only. Services on the same VM consume the Dapr APIs, as the Dapr sidecar model intends.
  • Default-deny firewall. ufw allows only TCP 22 inbound. Add rules only for management access you need.
  • Keep the runtime current. SecureAnyCloud patches the image at build time. Apply OS updates with sudo apt-get update && sudo apt-get upgrade, and consult SecureAnyCloud support for Dapr and Redis version upgrades.

Support

This image comes with 24/7 SecureAnyCloud support and a one-hour average response time for critical issues. Contact sales@secureanycloud.com for help with Dapr component design, wiring the sidecar into your services and CI, state store and pub/sub configuration, and planning the move from this single-node runtime to a production Kubernetes deployment.

Deploy on Azure

Launch Dapr 1.18.2 on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure