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, code interpreter sessions, using sessions and custom container sessions. 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 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 to allow, block or send a step to a person, approvals routed to a named approver, Vault for secrets that never enter a prompt, DLP on prompts and tool calls, and a hash-chained 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, LlamaIndex.TS, CrewAI over REST, the Vercel AI SDK and the OpenAI Agents SDK.

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 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 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.

Originally published on the Sandscale blog.