# Sandscale vs Azure Container Apps dynamic sessions for agent code

> A sourced comparison, as of November 2026, of Azure Container Apps dynamic sessions and Sandscale sandboxes: session pools and identifiers, Hyper-V vs Firecracker isolation, the 220-second execution limit, files, network defaults, auth and governance.

A sourced comparison, as of November 2026, of Azure Container Apps dynamic sessions and Sandscale sandboxes: session pools and identifiers, Hyper-V vs Firecracker isolation, the 220-second execution limit, files, network defaults, auth and governance.

November 27, 2026 · 4 min read · The Sandscale team

Azure Container Apps dynamic sessions are Microsoft’s managed sandboxes for running code that should not run next to your app, including code an LLM wrote. If your stack is on Azure, they are the obvious candidate. This post compares them with Sandscale sandboxes using Microsoft’s documentation as of November 2026: [dynamic sessions overview](https://learn.microsoft.com/en-us/azure/container-apps/sessions), [code interpreter sessions](https://learn.microsoft.com/en-us/azure/container-apps/sessions-code-interpreter), [using sessions](https://learn.microsoft.com/en-us/azure/container-apps/sessions-usage) and [custom container sessions](https://learn.microsoft.com/en-us/azure/container-apps/sessions-custom-container). Check them before you decide; several APIs carry preview version strings.

## The models differ

**Dynamic sessions** are organized around a **session pool**: an Azure resource with prewarmed, unallocated sessions. You do not create a session explicitly. You send a request to the pool’s management endpoint with an `identifier` query parameter, a string you choose (Microsoft suggests a user ID or conversation ID). If no session has that identifier, the pool allocates one; if one does, the request goes to it. A session stays allocated while requests keep coming and is destroyed after a cooldown period with no activity. You can also delete one explicitly.

There are two pool types. **Code interpreter** pools use platform-provided containers; the Python sessions come with packages such as NumPy, pandas and scikit-learn. **Custom container** pools run your own image, and requests are forwarded to your container’s target port, so you write the server inside.

**Sandscale sandboxes** are explicit. `sandboxes.create` starts one from a template (`builtin:python`, `builtin:node`, `builtin:go`, `builtin:base`, `builtin:minimal`, or your organization’s image pinned by digest) or from a snapshot, and returns its id. You run commands with `sandboxes.run`, move files with `writeFile` and `readFile`, and end it with `sandboxes.stop`, which deletes its disk. There is no server for you to write inside the box.

## Isolation

Microsoft says sessions use **Hyper-V isolation** and are isolated from each other and from the host. Sandscale runs each sandbox as its own **Firecracker microVM** with its own kernel. Both are hardware-virtualization boundaries rather than shared-kernel containers, which is what you want for untrusted code. [Isolating agent code with containers, gVisor or Firecracker](https://sandscale.dev/blog/isolating-ai-agent-code-containers-gvisor-firecracker) explains why the boundary matters.

## How long code can run

**Dynamic sessions.** For code interpreter sessions, each code execution is limited to a maximum runtime of **220 seconds**. The session itself lives until its cooldown period passes with no requests.

**Sandscale.** Each command has its own timeout, default 60 (in seconds), which you can set per run. The sandbox’s `timeoutSeconds` has a server default of 3600 and a maximum of 86400, within your plan; Free plan sessions are up to 4 hours. Between steps you can `pause` a sandbox and `resume` it later with memory and disk intact.

For agent work that includes test suites, builds or dependency installs, a 220-second cap per execution is the number to check first.

## Files

**Dynamic sessions.** Code interpreter sessions read and write files in `/mnt/data`. Upload is a multipart POST, with a documented upload limit of 128 MB per file; you can download, list and get metadata for files there.

**Sandscale.** Files live under `/workspace`. `writeFile`, `readFile` and `listFiles` work file by file; the REST API also accepts a gzip tar for a whole folder, and the CLI’s `sandscale sandbox run --sync .` sends a project folder. Snapshots save `/workspace` so new sandboxes can start from it.

## Network

**Dynamic sessions.** Microsoft’s docs say that by default sessions are prevented from making outbound network requests, and network status is configured on the session pool.

**Sandscale.** The SDK’s `network` option is `none` by default; `allowlist` uses your organization’s egress allowlist and presets, where your plan includes it.

Both start closed, which is the right default for agent code.

## Authentication and access

**Dynamic sessions.** Requests to the pool management API need a Microsoft Entra token, and the caller needs the Azure ContainerApps Session Executor role on the pool. Because anyone who can call the pool with a given identifier reaches that session, Microsoft’s best practices say to generate identifiers with cryptographic randomness and keep them out of URLs and logs.

**Sandscale.** API keys carry scopes and expire within 90 days. A sandbox is addressed by the id the server returned at create time, and calls are subject to your organization’s policy.

## Governance for agents

**Dynamic sessions** sit inside Azure’s controls: Entra, role assignments and Azure monitoring. Agent-specific controls, such as approving a particular command, are yours to build.

**Sandscale** includes them on every plan: [agent policy](https://sandscale.dev/security/agent-policy) to allow, block or send a step to a person, [approvals](https://sandscale.dev/security/approvals) routed to a named approver, [Vault](https://sandscale.dev/security/vault) for secrets that never enter a prompt, DLP on prompts and tool calls, and a hash-chained [audit log](https://sandscale.dev/security/audit-log). Audit log export and SSO with SAML or OpenID Connect are on Team and Enterprise.

## Framework integrations

Microsoft lists integrations for LangChain (`langchain-azure-dynamic-sessions`), LlamaIndex (`llama-index-tools-azure-code-interpreter`) and Semantic Kernel, all Python. Sandscale has a TypeScript SDK, a REST API, a CLI and an MCP server; our guides cover [LangGraph.js](https://sandscale.dev/blog/langgraph-js-agent-with-sandscale), [LlamaIndex.TS](https://sandscale.dev/blog/llamaindex-ts-agent-with-sandscale), [CrewAI over REST](https://sandscale.dev/blog/crewai-tools-on-sandscale-rest-api), the [Vercel AI SDK](https://sandscale.dev/blog/vercel-ai-sdk-tools-on-sandscale) and the [OpenAI Agents SDK](https://sandscale.dev/blog/openai-agents-sdk-with-sandscale).

## Billing

**Dynamic sessions.** Microsoft says code interpreter sessions are billed based on the duration of each session, and custom container sessions on the resources the session pool consumes. See [Azure Container Apps billing](https://learn.microsoft.com/en-us/azure/container-apps/billing) for rates.

**Sandscale.** Plans include awake vCPU-hours: 100 a month on Free, 1,500 on Pro ($20 a month billed annually, $25 monthly) and 2,000 per member pooled on Team ($40 per member a month billed annually, $48 monthly). The [plans reference](https://sandscale.dev/docs/reference/plans) says a box counts only while it is awake. Paid plans can add usage at $0.05 per awake vCPU-hour if you turn it on.

## Which fits

Choose **dynamic sessions** if you are on Azure, your agent mostly runs short Python snippets for analysis (well inside 220 seconds each), and you want sessions that appear on demand by identifier with Entra handling access.

Choose **Sandscale** if your agents run longer work such as test suites, builds or installs, need pause, resume and snapshots across steps, use toolchains beyond the built-in interpreter without writing a server for a custom container, or need policy, approvals and an audit trail for agent actions out of the box.

**On this page**

1. The models differ
2. Isolation
3. How long code can run
4. Files
5. Network
6. Authentication and access
7. Governance for agents
8. Framework integrations
9. Billing
10. Which fits

**Run your agents in a box of their own**

Each sandbox is a Firecracker microVM. Free includes 100 awake vCPU-hours a month.

[Start free](https://cloud.sandscale.dev/auth/signup)

## Keep reading

- [November 27, 2026 · **A LlamaIndex.TS data agent that runs its Python in a Sandscale sandbox** · Use LlamaIndex.TS's agent workflow with tools that write and run Python in a Firecracker sandbox, built per sandbox so a run can only reach its own box. Upload data files, answer with the numbers, clean up. Type-checked.](https://sandscale.dev/blog/llamaindex-ts-agent-with-sandscale)
- [November 27, 2026 · **Adding the Sandscale MCP server to Codex: config.toml, OAuth login and approval modes** · Configure the remote or local Sandscale MCP server in OpenAI Codex, sign in with codex mcp login, and use enabled_tools, approval modes and tool timeouts to match what each tool does.](https://sandscale.dev/blog/sandscale-mcp-server-in-codex)

---
Source: https://sandscale.dev/blog/sandscale-vs-azure-container-apps-dynamic-sessions
