sovara-server on Azure, protect it with
Microsoft Entra, connect the Remote desktop app, and connect project agents.
The default setup uses Azure CLI and deploys the published Sovara Server
container image to Azure Container Apps. Azure Container Apps is the recommended
starting point for small teams because it gives you managed HTTPS ingress,
container hosting, logs, and environment configuration without operating a VM or
Kubernetes cluster.
The same Entra and server configuration applies if you host Sovara on
an Azure VM, Azure App Service for Containers, AKS, or another reachable Azure
container platform.
Architecture Requirements
Any Azure hosting option must provide:- HTTPS endpoint reachable from user desktops.
- WebSocket support from the desktop app to the server.
- Reachability from agent machines that will report runs.
- Environment variable or secret configuration for
sovara-server. - Reachable PostgreSQL or MongoDB database for Sovara state.
- Outbound HTTPS from the server to Microsoft identity endpoints for OIDC/JWKS.
Choose an Azure Hosting Model
| Hosting model | Use when | Notes |
|---|---|---|
| Azure Container Apps | You want the simplest managed serverless container deployment. | Recommended default for initial enterprise setup. |
| Azure App Service for Containers | The organization standardizes on App Service. | Configure the same image, env vars, HTTPS, and WebSocket support. |
| Azure VM | You already operate VMs or want direct OS/reverse-proxy control. | Run the container or service behind Nginx, Caddy, Azure Application Gateway, or another HTTPS proxy. |
| AKS | You already operate Kubernetes. | Use normal Deployment, Service, Ingress, env var, and persistent volume primitives. |
- Azure Container Apps overview
- Azure App Service custom containers
- Linux virtual machines in Azure
- Azure Kubernetes Service
Prerequisites
You need:- An Azure subscription in the Microsoft Entra tenant where your users sign in.
- Permission to create app registrations in that tenant.
- Permission to create the selected Azure hosting resources.
- A PostgreSQL or MongoDB database reachable from the Sovara Server hosting environment.
- Azure CLI installed and authenticated.
- The published Sovara Server container image tag from Sovara.
- The Remote desktop app build.
- Install Azure CLI
- Authenticate with Azure CLI
- Manage subscriptions with Azure CLI
- Install Azure PowerShell, if the admin workflow uses the Az PowerShell module
- Connect-AzAccount, if the admin workflow uses the Az PowerShell module
- Register an application in the Microsoft identity platform
- Expose a web API
- Configure client access to a web API
- Authorization code flow with PKCE
- Azure CLI app registration commands
- Azure CLI app permission commands
- Microsoft Graph application update API
- Azure Container Apps quickstart
- Azure Container Apps environment variables
- Azure Container Apps secrets
- Azure Container Apps log streaming
- MongoDB Atlas on Microsoft Azure
- MongoDB Atlas IP access lists
- MongoDB Atlas driver connection strings
Setup Variables
Choose names before running commands. Container App names must be lowercase, start with a letter, end with a letter or number, and be less than 32 characters. SetSOVARA_IMAGE to the published image tag Sovara gives you. Then choose one
database backend and set only the variables for that backend. The deployment
examples below use MongoDB Atlas first, but PostgreSQL and SQLite are also
supported.
Common Variables
- Bash
- PowerShell
Database Variables
Choose exactly one database backend for the server deployment.- MongoDB Atlas
- PostgreSQL
- SQLite
- Bash
- PowerShell
Sign In and Select the Subscription
- Bash
- PowerShell
TenantId and subscription are the ones you expect. If
az account set says the subscription does not exist, sign in with the tenant
explicitly again and confirm that your user has access to that subscription.
Create the Entra App Registrations
Sovara uses two app registrations:- The Server API app represents the Sovara Server API and exposes the
access_as_userdelegated scope. - The Desktop app is a public client. It uses PKCE and the loopback redirect URI
http://localhost/auth/callback. It has no client secret.
Create the Server API App
- Bash
- PowerShell
Expose the access_as_user Scope
The scope ID must be a GUID. The commands below patch the app manifest through
Microsoft Graph because the scope object is easier to set exactly that way.
- Bash
- PowerShell
Create the Desktop Public Client App
- Bash
- PowerShell
Grant Admin Consent
If tenant users are allowed to consent to this delegated permission themselves, this step may not be required. For enterprise tenants, ask a tenant admin to run it or grant consent in the Portal.- Bash
- PowerShell
Configure Sovara Server Auth
Every hosting model must pass these Entra/OIDC environment variables tosovara-server:
0.0.0.0:5959. The Azure hosting layer should
terminate HTTPS and forward traffic to port 5959.
Configure Database and Storage
Sovara needs persistent state for projects, memberships, agent tokens, runs, annotations, priors, and model settings. For Azure deployments, configure the database at server deployment time. Do not store the MongoDB URI or PostgreSQL DSN in the desktop app or in normal project settings. Use one of these supported backends:- PostgreSQL: set
SOVARA_DB_BACKEND=postgresqlandSOVARA_PG_DSN. - MongoDB: set
SOVARA_DB_BACKEND=mongodb,SOVARA_MONGODB_URI, andSOVARA_MONGODB_DB.
MongoDB Atlas on Azure
MongoDB Atlas is the recommended first MongoDB path because it gives you a managed MongoDB cluster without running database servers yourself.- In MongoDB Atlas, create or select an Atlas project.
- Create a cluster with Microsoft Azure as the cloud provider. Choose the same Azure region as the Sovara Server when possible.
- In Database Access, create a database user for Sovara. Grant it read/write
access to the
sovaradatabase. - In Network Access, allow the Sovara Server hosting environment to connect.
For a temporary validation deployment,
0.0.0.0/0works because it allows any IPv4 source address, including Azure Container Apps outbound IPs. Before using the deployment with real workspace data, replace it with Atlas private networking or a stable Azure outbound IP allowlist. - In the cluster Connect flow, choose Drivers and copy the
mongodb+srv://...connection string. - Replace the placeholder username and password in that string with the database user credentials.
- Set
SOVARA_MONGODB_URIto that full connection string andSOVARA_MONGODB_DBtosovara.
mongodb-uri secret inline. If you are updating an existing
Container App, create or replace the secret and reference it from the runtime
environment:
- Bash
- PowerShell
- Bash
- PowerShell
PostgreSQL
If your organization standardizes on PostgreSQL, create a reachable PostgreSQL database and use a DSN like:--secrets pg-dsn=... in the
create command and set SOVARA_PG_DSN=secretref:pg-dsn. If you are updating an
existing Container App, store the DSN as a secret and reference it from
SOVARA_PG_DSN:
- Bash
- PowerShell
SQLite
SQLite is acceptable for local development, single-machine testing, and temporary validation deployments. Do not use SQLite as the system of record for an Azure Container Apps deployment unless you have explicitly attached durable storage and accepted the operational tradeoffs. For shared Azure deployments, choose a managed MongoDB or PostgreSQL backend.Deploy Sovara Server on Azure Container Apps
This is the recommended default path for small Azure deployments. The command below uses MongoDB Atlas as the database example and stores the Atlas connection string as a Container App secret. If your organization uses PostgreSQL, use the PostgreSQL secret and env vars from Configure Database and Storage instead.Create the Resource Group and Container Apps Environment
- Bash
- PowerShell
Create the Container App
The published container listens on port5959. Azure Container Apps gives it a
public HTTPS endpoint and forwards traffic to that port.
- Bash
- PowerShell
Get the Server URL
- Bash
- PowerShell
Alternative Azure Hosting Notes
Azure VM
Run the published Sovara Server image or service on the VM, bind it to an internal port, and put HTTPS in front of it with your standard reverse proxy. The reverse proxy must pass WebSocket upgrades. Make sure the VM can reach the configured PostgreSQL or MongoDB database endpoint.Azure App Service for Containers
Use the published image, configure the same server environment variables, enable HTTPS, and ensure WebSocket support is enabled. Store the database connection in App Service configuration or Key Vault references, and pass it tosovara-server with the same environment variable names.
AKS
Use the published image in a Deployment, expose it through your Ingress controller, configure the same environment variables as Kubernetes secrets/config maps, and make sure the cluster can reach the configured PostgreSQL or MongoDB database endpoint.Verify the Server
- Bash
- PowerShell
/auth/config response should include:
Connect the Remote Desktop App
- Open the Remote desktop app.
- Enter the server HTTPS URL.
- Click Connect.
- Click Sign in with Microsoft.
- Complete the browser login.
- Confirm the desktop app shows your Entra profile.
- Create a project. The creator becomes project admin.
Connect an Agent Project
Open the project settings in the Remote desktop app and create an agent token. The generated command should already include the server URL, project ID, and agent token.- Bash
- PowerShell
Access Model
The Entra token only proves who the user is. Sovara project access still comes from the Sovara database:- Project creators become
admin. - Admins can add members and create agent tokens.
- Editors and viewers cannot create agent tokens.
- Agent tokens can only write runs to their bound project.
Troubleshooting
az account set Cannot Find the Subscription
Confirm that you logged into the correct tenant:
- Bash
- PowerShell
App Registration Creation Fails
The tenant may block users from creating app registrations. Ask an Entra admin to either run the app registration steps or temporarily grant the required permission. Microsoft documents the Portal flow in Register an application.Desktop Login Shows Redirect URI Mismatch
Check the Desktop app registration:- It must be a public client/native app.
- It must have
http://localhost/auth/callbackas a redirect URI. - The Sovara Server env var
SOVARA_DESKTOP_CLIENT_IDmust be the Desktop app application client ID, not the Server API app client ID.
Desktop Login Shows Invalid Audience or Scope
Check the Server API app and server env vars:SOVARA_OIDC_AUDIENCEmust equal the Server API app client ID.SOVARA_DESKTOP_SCOPESmust equalapi://<server-api-client-id>/access_as_user.- The Desktop app must have the delegated
access_as_userpermission for the Server API app. - If tenant policy requires it, admin consent must be granted.
Desktop Cannot Load Auth Config
Run:- Bash
- PowerShell
MongoDB Connection Fails
Check the Container App logs first. Common causes:Authentication failed: the Atlas database username or password in themongodb-urisecret is wrong. Reset the Atlas database user password, update the Container App secret, and restart the active revision.ServerSelectionTimeoutErroror connection timeout: the Atlas IP access list or private networking is blocking the Sovara Server outbound connection.Cannot specify multiple hosts with directConnection=true: the server image is too old for Atlasmongodb+srv://...URIs. Deploy a Sovara Server image that supports Atlas SRV connection strings.
0.0.0.0/0 in the Atlas IP access list
confirms that the database and credentials work. Before using the deployment
with real workspace data, replace it with private networking or a restricted
allowlist.
Inspect Azure Container Apps Logs
- Bash
- PowerShell
Inspect Azure Container Apps Environment Variables
- Bash
- PowerShell
Clean Up and Retry
To retry from scratch, delete the Azure resource group and both app registrations.- Bash
- PowerShell
sovara connect-agent command from that project’s settings.