The platform on Azure
You need a terminal only once, to create the platform. After that everything happens in the console.
1. Create the platform (pick one):
no terminal: sign in to Azure, choose a resource group, set the administrator password and press Create. When it finishes, open the
consoleUrloutput.- Or from a terminal:
az loginandobskitpy cloud azure up acme(same template, and it signs the CLI in for you).
It creates one resource group with a VM running the stack (portal, console, Elasticsearch, Collector) behind HTTPS on the address Azure
gives the VM (*.cloudapp.azure.com), a container registry and a Container Apps environment (an existing one in the region is reused:
Azure allows one per region) with a persistent file share for the robots' output. Only ports 80 and 443 are open, there is no SSH, telemetry
needs an ingest token and Elasticsearch is readable only by signed-in portal users. The first start takes about 10 minutes.
2. Put a robot on it, in the console: register the robot (Orchestration, Robots), connect GitHub (CI/CD) and, in the pipeline builder,
turn on Deploy approved releases to this platform's Azure jobs. obskitpy opens a Pull Request with the workflows and stores the two secrets
they need in the repository. When a deployment is approved, the workflow builds the robot image on GitHub (your project plus obskitpy, so the
robot depends on the SDK like in production) and the platform copies it into its registry and creates or updates the robot's Container Apps
Job. No Azure credential ever reaches GitHub: the platform acts with the managed identity of its VM.
From then on the portal starts the job whenever a run is queued, and only that job's agent takes the run. Logs, traces and metrics come back over OTLP/HTTP.
Prefer a terminal for a robot? obskitpy robot deploy MY_ROBOT --source . does the same (it needs az and Docker on your machine).
obskitpy cloud azure status shows the deployment and obskitpy cloud azure down NAME deletes the whole resource group (VM, registry, jobs and
all data). Needs on your machine for the terminal path: az (logged in).
Cost: the default VM (Standard_D2as_v7, 2 vCPU, 8 GB) is the main item, roughly 70 USD per month if left on, plus the registry and the
file share. Jobs bill only while they run.
Data that outlives a job. The file share is mounted at /data (<robot>/<env> inside it), so a robot's output survives each execution.
When the subscription already has a Container Apps environment in the region it is reused and /data is not persistent.
Least privilege. Each job runs with the token of its own service user (agent-<job>@obskitpy.local, operator role): it can run and report
robots, not administer the portal. Job agents disappear from the Agents list an hour after their execution ends.
Verified on Azure
A new project that depends on the SDK was deployed with these commands to a real subscription (Brazil South): the run was started by the portal, ended SUCCEEDED, and its spans and logs reached the platform's Elasticsearch. Not verified: other regions, private repositories as robot sources.
Running a long-lived agent yourself (manual)
1. Prepare
- A portal the agent can reach over HTTPS (set
OBSKITPY_PUBLIC_ORIGIN/ put it behind your gateway). - An API token for an
operatoraccount: runobskitpy login ...(the token is stored in~/.config/obskitpy/credentials.json) or callPOST /api/v1/tokens, and keep it as a secret. There is no screen for tokens yet. - Credentials the robots need, by the names you gave them (
--credential SAP_PROD_USER).
2. Build and push the image
cd obskitpy/docker
docker build -f agent.Dockerfile -t myregistry.azurecr.io/obskitpy-agent:1.0.0 .
az acr login --name myregistry && docker push myregistry.azurecr.io/obskitpy-agent:1.0.0
If your robots have dependencies, build your own image FROM this one and pip install -r requirements.txt.
3. Run it (one of)
Azure Container Apps (a long-running agent):
az containerapp create --name obskitpy-agent --resource-group RG --environment ENV \
--image myregistry.azurecr.io/obskitpy-agent:1.0.0 --min-replicas 1 --max-replicas 1 \
--secrets obskitpy-token=<API_TOKEN> sap-user=<VALUE> \
--env-vars OBSKITPY_URL=https://portal.example.com OBSKITPY_TOKEN=secretref:obskitpy-token SAP_PROD_USER=secretref:sap-user \
--args "--capacity" "4" "--label" "cloud=azure"
Azure Container Instances works the same way with az container create --environment-variables/--secure-environment-variables.
A VM can simply run obskitpy agent run under systemd. For secrets, prefer Key Vault references so values reach the container
only as environment variables.
4. Check
Orchestration → Agents lists the agent as online with its labels (cloud=azure), capacity and last heartbeat. Several agents can
serve the same portal: runs are handed out atomically and each robot's concurrency limit holds across all of them.
Telemetry from the cloud
Give the agent --otlp-endpoint (or OBSKITPY_OTLP_ENDPOINT) pointing to an OpenTelemetry Collector the container can reach; robots
receive it as OTEL_EXPORTER_OTLP_ENDPOINT, together with the service name, environment, run and version.