← Back to articles Azure

Public Preview: Markdown for Agents in Azure App Service

Public Preview: Markdown for Agents in Azure App Service

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.

⚠ Public Preview This feature is in public preview as of August 2026. It is not covered by an SLA and should not be used in production workloads without thorough testing. Behavior may change before GA.
Azure OpenAI gpt-4o / gpt-4-turbo Markdown tokens AZURE APP SERVICE Server-side MD Parser XSS Sanitizer Rendered HTML Client UI React / Vue / Portal Markdown Rendered ✓ STREAMING Progressive render LLM BACKEND HOSTING LAYER CONSUMER
End-to-end flow: Azure OpenAI generates Markdown tokens → App Service parses and sanitizes them → the client UI renders formatted HTML. Streaming is supported throughout.

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
AvailabilityPublic 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 OSLinux-based plans recommended; Windows limited in preview
Min App Service tierBasic (B1/B2) or higher
Runtime stacksPython 3.11+, Node.js 18+, .NET 8 (LTS)
GA dateNot announced
💡 Preview Registration Some subscriptions may require explicit feature registration. Run 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.

BEFORE App code owns Markdown parsing Developer adds rehype-sanitize / DOMPurify Manual streaming buffer logic required XSS risk if sanitization is misconfigured Extra NPM/PyPI dependencies per project EVERY APP REINVENTS THE WHEEL AFTER (Preview) Platform-level Markdown parsing Built-in XSS sanitization (allowlist) Native streaming-aware rendering One app setting enables the feature No extra dependencies required SET FLAG AND SHIP
Before vs. After: previously each agent app handled its own Markdown pipeline. With this preview, App Service takes on parsing, sanitization, and streaming rendering at the platform layer.

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.

🚧 Critical: Never skip sanitization on the client side Even with platform-level sanitization enabled, do NOT pass raw LLM output directly to 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

  1. 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
  2. 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
  3. 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']"
  4. 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."}
    ]
  5. Add client-side sanitization — Even with platform sanitization, add rehype-sanitize or DOMPurify to your frontend as defense-in-depth. Never use raw dangerouslySetInnerHTML.
  6. 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
  7. 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.
  8. 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"
🔗 Official Announcement Track updates and GA timelines on the Azure Updates page for this feature. Subscribe to the App Service category for notifications when preview behavior changes or GA is announced.
Gotcha Impact Mitigation
Feature flag not propagatingMarkdown not renderedRun az webapp restart after setting the app setting
Streaming partial tokensRendering artifacts (broken bold, open code blocks)Buffer partial tokens; use streaming-aware Markdown library
GFM extensionsTables / task lists may not renderTest with CommonMark syntax first
Cold starts (Consumption plan)High streaming latencyUse B1+ plan with Always On enabled
Token truncationMarkdown documents cut off mid-blockSet max_tokens=4096 or higher on the completion call
CORS blocked requestsFrontend cannot reach agent endpointAdd allowed origin via az webapp cors add

Was this article helpful?

🎓 Ready to go deeper?

Practice real MD-102 exam questions, get AI feedback on your weak areas, and fast-track your Intune certification.

Start Free Practice → Book a Session
Souhaiel Morhag
Souhaiel Morhag
Microsoft Endpoint & Modern Workplace Engineer

Souhaiel Morhag is a Microsoft Intune and endpoint management specialist with hands-on experience deploying and securing enterprise environments across Microsoft 365. He founded MSEndpoint.com to share practical, real-world guides for IT admins navigating Microsoft technologies — and built the MSEndpoint Academy at app.msendpoint.com/academy, a dedicated learning platform for professionals preparing for the MD-102 (Microsoft 365 Endpoint Administrator) certification. Through in-depth articles and AI-powered practice exams, Souhaiel helps IT teams move faster and certify with confidence.

Related Articles

Popular on MSEndpoint