BRK446 · Breakout
Build portable applications with Adaptive Apps
Speakers: Haishi Bai, Boris Scholl
Microsoft’s player cannot open a video at a given time: once it plays, skip to the time shown.
What the session covers
Haishi Bai presents Adaptive Apps, a design pattern (not a framework) for writing an application once and running it on Azure, Arc, local Kubernetes or other clouds, motivated by sovereignty, compliance and disconnection concerns. He explains the layered abstraction model with abstract resources, environments and recipes, plus an authentication pattern using an app-local Keycloak federated with Microsoft Entra, and demos a stock-trading app failing over from Azure to a local K3s cluster. The session then extends the pattern to Adaptive AI with an agentic stack (agent gateway, Microsoft Foundry, LiteLLM, KAITO, OpenTelemetry, OPA policies) and a portable agent as the longer-term goal. Demos show agent memory synchronized from cloud to local and a grant-based consumption pattern governing 100 unreliable agents offline.
Best for: Architects and platform engineers designing sovereign, edge or disconnected-capable applications and AI agents on Azure Arc, Kubernetes and Microsoft Foundry.
New material starts at 23:09. Before 23:09 the session explains the existing Adaptive Apps pattern and its demo; at 23:09 the extension to Adaptive AI and the agentic stack begins.
Where to skip: If you know Adaptive Apps, skip to 23:09 for the Adaptive AI stack; the memory failover demo at 28:17 and grant-based governance at 34:11 with the 100-agent demo at 36:05 are the core. Newcomers should watch 10:52–23:09 for recipes, the Keycloak–Entra pattern and the failover demo; skip the intro and the closing at 41:02.
Chapters (12)
- 00:01 Recap Depth 100 · Novelty 0/3
Session intro: why Microsoft shows how to get off Azure
Haishi Bai introduces the session alone and explains that he and co-presenter Boris Scholl act as an active-active backup for each other. He frames Adaptive Apps as a way to run on Azure but exit it in a streamlined, safe way if needed. The motivation is customer concern about data residency, sovereignty, compliance and geopolitics, and the question of keeping the business running if disconnected from Azure.
- 02:43 Deep dive Depth 200 · Novelty 1/3
Why now: Arc and Radius maturity, and limits of earlier portability approaches
The speaker states Azure public cloud aims to be sovereign by default, and Adaptive Apps is a design pattern to use until then. Maturity of Arc-enabled services and the open-source Radius project, plus demand for local AI inference, make it timely. He reviews prior approaches: platform parity, lowest-common-denominator feature sets, runtime abstractions like Dapr, and portable application servers, and explains why each falls short.
- 07:03 Deep dive Depth 200 · Novelty 1/3
Adaptive Apps principles: pattern not framework, no lock-in, provisioning-time only
The goal is write once and run on Azure, Arc, local Kubernetes, servers or other clouds. Principles: it is a design pattern rather than a framework, no lock-in including to Microsoft, and the data plane and management plane stay native while the tooling only acts at provisioning time. Day-2 operations go through the native management plane, and customers can adopt the pattern incrementally; customers reportedly feel more comfortable staying on Azure knowing they can exit.
- 10:52 Deep dive Depth 300 · Novelty 1/3
Layered abstraction, abstract resources, environments and recipes
Adaptive Apps uses six abstraction layers (plus a substrate layer) mapped to protocols and neutral open-source projects into an opinionated stack. An adaptive app definition declares platform-agnostic abstract resources such as ingress, service or database; each environment loads recipes that hydrate them into concrete services, e.g. Azure Front Door and AKS pods on Azure. Code is written against chosen protocols, e.g. MQTT for messaging, with recipes mapping to different brokers; covered concerns include authentication, authorization, messaging, AI model management, workload identity and governance.
- 15:17 Deep dive Depth 300 · Novelty 1/3
Authentication pattern: app-local Keycloak federated with Microsoft Entra
Microsoft Entra ID is recommended on Azure, but disconnected or air-gapped environments break new logins even with token caching. The pattern has the application bring its own OIDC identity provider, Keycloak, which is as available as the application itself. It federates with Microsoft Entra and local Active Directory, and Entra Connect can synchronize credentials from local AD to the Entra tenant.
- 17:10 Demo Depth 300 · Novelty 1/3
Demo: same stock-trading app on Azure and on a local K3s cluster
A multi-tier stock-trading app (front end and back end in different languages communicating over MQTT) runs on Azure with Keycloak federated with Entra, agent and AI gateways, Azure Event Grid and agents on Microsoft Foundry. The speaker shows the resource group, Kubernetes services, Keycloak's Entra identity provider configuration and signs in via Entra with face authentication. He then shows the local failover deployment on a K3s cluster on his laptop using a Mosquitto MQTT broker and KAITO for local models.
- 23:09 New Depth 300 · Novelty 2/3
Extending to Adaptive AI: agentic stack choices and portable agent goal
Adaptive Apps was introduced a few months ago with positive response, hackathons and prototypes, and is now being extended to Adaptive AI. After surveying the agentic ecosystem along the calling chain, the stack uses an agent gateway to bootstrap agent identities, Microsoft Foundry or other hosting, any agent framework, LiteLLM as AI gateway/router, KAITO for serving, OpenTelemetry, Keycloak and an agent governance toolkit with OPA policies. AI gateways enable smart routing of simple requests to smaller or local models to balance performance and token cost; the longer-term goal is a portable agent.
- 28:17 Demo Depth 200 · Novelty 2/3
Demo: agent memory failover from cloud to local
In early, unpolished work, a memory portability layer synchronizes agent memory committed in the cloud to the client so a failed-over agent keeps context. The speaker stores facts in the cloud agent's memory, then on the local deployment asks it to recall which number Boris picked and gets 42. Memory is stored in PostgreSQL synchronized between cloud and local, and other stores can be used.
- 32:05 Deep dive Depth 300 · Novelty 1/3
Data synchronization guidance: start with one-way sync
For data in sources such as Microsoft Fabric, the recommended pattern is one-way synchronization with the cloud database as single source of truth, syncing selected elements or ontologies locally to avoid conflicts. The memory demo uses one-way commit, so an attempt to override the memory on the client fails because local memory is read-only. Data synchronization is not part of the toolchain; customers should use their data platform's own replication tools.
- 34:11 New Depth 300 · Novelty 2/3
Grant-based consumption: offline-enforceable agent governance
For enterprise agent governance regardless of connectivity, a new pattern called grant-based consumption is added. A cloud grant management system periodically issues grants (e.g. up to $1,000 per hour) to agents, which can keep operating while disconnected as long as they hold a valid grant; requests over quota are rejected. Grants are encrypted on the server, verified on the client, and client activity is recorded in an immutable ledger.
- 36:05 Demo Depth 300 · Novelty 2/3
Demo: 100 unreliable pizza agents governed by grants
A sample pizza-factory app runs 100 agents to produce 1,000 pizzas under a grant policy: $5 per pizza, small initial balance, periodic refills and a $60 ceiling per agent. Failure injection disconnects agents 30% of the time and crashes them 10% of the time; crashed, disconnected and quota-exhausted (sleeping) agents are shown in different colors. Locally queued work is reconciled on reconnection so the target is met exactly, and a flow chart shows the initial ramp-up as grants accumulate.
- 41:02 Closing Depth 100 · Novelty 0/3
Resources, open-source repo and micro-hackathon template
The speaker points to the open-source public repo, documentation on Azure Architecture Center, YouTube resources and the Radius project. He invites contributions via issues, PRs and forks, and mentions a half-day micro-hackathon template customers can run themselves. The session closes with a pointer to the feedback QR code.
Announcements (4)
-
Adaptive AI
Extension of the Adaptive Apps pattern to agentic AI workloads with an opinionated stack of agent gateway, AI gateway, model serving, observability, identity and governance.
Speaker’s quote (at 23:35)
„Then we think, well, it's a natural extension so that we can expand the adaptive apps to adaptive AI as well.“
-
Portable agent
Longer-term goal of making agents themselves adaptable and portable across environments.
Speaker’s quote (at 27:50)
„But our longer term goal is to actually have this portable agent.“
-
Portable agent memory
A memory portability layer that synchronizes agent memory from cloud to client so a failed-over agent can continue the conversation.
Speaker’s quote (at 28:42)
„So what we did is that we set up this like a memory portability layer so that if you commit the memory on one side, it will be synchronized.“
- 34:37 not stated
Grant-based consumption pattern
Agents receive periodic encrypted grants from a cloud grant service so policy and quotas are enforced even when they are disconnected.
Speaker’s quote (at 34:37)
„So this is why we are adding another pattern into this adaptive app, which is called grant-based consumption.“
Demos (3)
-
Show that one multi-tier application runs on Azure-native infrastructure and fails over to a fully local K3s deployment, with federated sign-in via Entra.
Steps (9)
- Open the stock-trading app (front end and back end communicating via MQTT).
- Review the deployment's platform features: Keycloak federated with Entra, agent gateway, AI gateway, Azure Event Grid, agents on Foundry.
- Open the Azure resource group: Kubernetes cluster, Event Grid and data collectors.
- List the Kubernetes services: Istio, OpenTelemetry collectors, Keycloak deployment.
- Show the user Alice logged in as a local Keycloak user.
- In the Keycloak admin console, show Entra configured as an identity provider.
- In the Entra tenant, show the mutual federation trust to the local environment and the registered user.
- Open a private browser window, choose sign in with OIDC, select Entra and authenticate with face recognition.
- Switch to the local deployment on a K3s cluster on the laptop, using a Mosquitto MQTT broker instead of Event Grid and KAITO for local models.
Prerequisites: Azure subscription with Kubernetes cluster and Event Grid, an Entra tenant federated with Keycloak, a local K3s cluster; sample code in the public repo.
-
Show that an agent failed over from cloud to a local environment keeps conversation context through synchronized memory.
Steps (5)
- In the cloud deployment, tell the agent to remember a fact.
- Sign in as Alice, the account used for memory synchronization.
- Tell the agent that Boris said 42; it is saved to the advisor memory in PostgreSQL.
- Switch to the local failed-over deployment.
- Ask the agent to recall from memory which number Boris picked; it answers 42 from the locally synchronized database.
Prerequisites: Cloud and local deployments of the agent with a PostgreSQL memory store synchronized between them.
-
Show that grant policies are enforced and work is reconciled across 100 agents despite crashes and disconnections.
Steps (6)
- Open the grant policy: pizza cost $5, small initial balance in cents, refill per tick and a maximum ceiling of $60 per agent.
- Configure failure injection: 30% chance of disconnection, 10% chance of crash.
- In Overview, load 100 agents and confirm they are online.
- Launch the job to make 1,000 pizzas.
- Observe red (crashed), yellow (disconnected) and blue (sleeping, lifetime quota exceeded) agents.
- Open the flow view to see the ramp-up, locally queued pizzas during network congestion and later reconciliation.