What's Changing
Microsoft has announced the public preview of Markdown for Agents in Azure App Service, effective as of August 2025. This feature gives AI agents and automation tools hosted on App Service a native, platform-level mechanism to return and render Markdown-formatted responses — clean headings, lists, code blocks, and bold/italic text — rather than raw plain text or hand-rolled HTML. When a client requests Markdown, App Service can automatically handle server-side parsing and surface a sanitized, rendered output to supported client interfaces.
Who's Affected & When
This preview is available to any Azure subscription with access to Azure App Service. There is no tenant-level or AAD restriction. The feature targets developers building AI-agent workloads and does not affect standard web app hosting scenarios in any way — it is entirely opt-in via an app setting flag.
| Dimension | Detail |
|---|---|
| Availability | Public Preview — all Azure regions where App Service is available |
| Opt-in required | ✓ Must set WEBSITE_AGENT_MARKDOWN_ENABLED=true app setting |
| Auto-enabled | ✗ Never auto-applied to existing apps |
| Supported OS | Linux-based plans recommended; Windows limited in preview |
| Min App Service tier | Basic (B1/B2) or higher |
| Runtime stacks | Python 3.11+, Node.js 18+, .NET 8 (LTS) |
| GA date | Not announced |
az feature register --namespace Microsoft.Web --name AgentMarkdownRendering and allow 15–30 minutes for propagation before testing.
What This Means for Your Environment
If you are already running AI agent workloads on App Service — whether built with Semantic Kernel, Azure OpenAI Assistants, AutoGen, or a plain SDK loop — this feature removes the need to build your own Markdown pipeline at the application layer. The parsing and XSS sanitization move to the platform, reducing boilerplate code and a common class of injection vulnerabilities.
For teams not yet on App Service for agent hosting, this is a meaningful reason to evaluate it: combined with Easy Auth, managed identity, and built-in streaming log support, App Service becomes a competitive host for production-bound agent applications.
What improves immediately:
- Formatted agent responses (headings, code blocks, tables) rendered correctly in supported UIs without custom middleware.
- Reduced XSS surface area — platform sanitization uses a safe HTML allowlist by default.
- Progressive Markdown rendering during LLM streaming, avoiding the need for custom token-buffering logic.
Nothing breaks for existing apps. The feature is additive and strictly opt-in.
dangerouslySetInnerHTML in React or equivalent APIs in other frameworks. Always layer client-side sanitization with DOMPurify or rehype-sanitize as a defense-in-depth measure.
Action Items
-
Register the preview feature — Run the following in Azure CLI to opt your subscription in. Allow up to 30 minutes for propagation.
# Register the preview feature flag az feature register \ --namespace Microsoft.Web \ --name AgentMarkdownRendering # Confirm registration state (wait for "Registered") az feature show \ --namespace Microsoft.Web \ --name AgentMarkdownRendering
-
Enable the feature flag on your App Service — Set the app setting and restart the app to apply it.
az webapp config appsettings set \ --name myAgentApp \ --resource-group myRG \ --settings WEBSITE_AGENT_MARKDOWN_ENABLED=true # Restart required for the setting to take effect az webapp restart \ --name myAgentApp \ --resource-group myRG
-
Verify the setting is active — Confirm the app setting is present before testing.
az webapp config appsettings list \ --name myAgentApp \ --resource-group myRG \ --query "[?name=='WEBSITE_AGENT_MARKDOWN_ENABLED']"
-
Update your agent system prompt — Instruct the LLM to return Markdown-formatted responses so the parser has well-formed input to work with.
# Python / Azure OpenAI SDK v1.x messages=[ {"role": "system", "content": "Always format your responses using Markdown."}, {"role": "user", "content": "Explain Azure App Service tiers."} ]
-
Add client-side sanitization — Even with platform sanitization, add
rehype-sanitizeorDOMPurifyto your frontend as defense-in-depth. Never use rawdangerouslySetInnerHTML. -
Enable Always On for non-Consumption plans — Prevent cold starts from degrading streaming latency on agent endpoints.
az webapp config set \ --name myAgentApp \ --resource-group myRG \ --always-on true
- Test with CommonMark-compatible Markdown first — GitHub Flavored Markdown (GFM) extensions such as tables and task lists may not be fully supported in preview. Validate your agent's output format against CommonMark before relying on GFM syntax.
-
Configure CORS if frontend is on a separate origin — Required if your React/Vue frontend is hosted on a different domain.
az webapp cors add \ --name myAgentApp \ --resource-group myRG \ --allowed-origins "https://yourfrontend.com"
| Gotcha | Impact | Mitigation |
|---|---|---|
| Feature flag not propagating | Markdown not rendered | Run az webapp restart after setting the app setting |
| Streaming partial tokens | Rendering artifacts (broken bold, open code blocks) | Buffer partial tokens; use streaming-aware Markdown library |
| GFM extensions | Tables / task lists may not render | Test with CommonMark syntax first |
| Cold starts (Consumption plan) | High streaming latency | Use B1+ plan with Always On enabled |
| Token truncation | Markdown documents cut off mid-block | Set max_tokens=4096 or higher on the completion call |
| CORS blocked requests | Frontend cannot reach agent endpoint | Add allowed origin via az webapp cors add |