Docs & Code Guide

Embed a diagram in an Azure DevOps wiki: what its markdown allows and where Mermaid stops

Azure DevOps wiki markdown sits between GitHub's strictness and a docs site's freedom: it allows a limited HTML subset, extends image syntax with its own sizing notation, and ships a built-in Mermaid renderer that runs a version old enough to matter. Here is what each of those means for an architecture diagram you want to stay current.

7 min readFor teams documenting architecture in Azure DevOps wikis

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

189/20003 credits left
Try:

No account needed · Editable canvas, not a picture

The image syntax, including ADO's sizing extension

Standard markdown images render in wiki pages, and external URLs are fetched at view time, which is what makes a live diagram possible: point the image at an endpoint that re-renders on change and the wiki page follows without edits.

Azure DevOps adds its own sizing notation that most platforms lack: append =WIDTHxHEIGHT inside the parentheses, after the URL, to set display dimensions. Height is optional (=600x works too). This controls display size only; for a sharper source on wide pages, the Datadef endpoint also takes render parameters for width, height, and scale.

![Platform architecture](https://datadef.io/api/embed/my-platform-a1b2c3d4 =900x)

<!-- Sharper render for a full-width page section -->
![Platform architecture](https://datadef.io/api/embed/my-platform-a1b2c3d4?width=2400&height=1400 =1100x)

The HTML subset, and why your iframe will not render

Unlike GitHub, the ADO wiki does accept some raw HTML in markdown: basic formatting tags survive. But iframes are restricted to an allowlist of video providers, YouTube and Microsoft Streams among them, so an iframe pointing at an arbitrary interactive diagram page will not render. The interactive form of an embed is effectively unavailable in the wiki.

The practical pattern is the one the image supports: a live image in the page, with the image linked to the full diagram for readers who want to pan and zoom there. Wrap the image markdown in a link the usual markdown way and both needs are met.

The ::: mermaid block and its caveats

The wiki renders Mermaid through its own fence syntax: a line with ::: mermaid, the diagram source, and a closing :::. Two caveats keep tripping teams. First, the wiki runs Mermaid 8.13.9, several major versions behind current, so syntax copied from recent Mermaid documentation often fails to render. Diagram types in experimental mode at that version, entity relationship and git graph among them, are not included, and the docs steer you to graph rather than flowchart syntax.

Second, the general Mermaid ceiling applies with the older version pulling it lower: generated layout communicates well up to roughly 20 nodes and degrades past that. Sequence diagrams of a single flow are the sweet spot. A full platform view with zones and detail belongs in a deliberately laid out diagram behind a live image URL.

Project wiki vs code wiki

Azure DevOps has two wiki modes and the difference matters for diagram workflows. A provisioned project wiki is edited in the web UI and stored in a repo Azure DevOps manages for you. A code wiki publishes a folder of markdown from a repository you own, which means wiki pages ride your normal PR flow: branch, review, merge, published.

For a live diagram the markdown is identical in both. The code wiki pairs better with automation, because the same pipeline that merges a change to the system can also carry the reminder, or the agent call, that updates the diagram the page shows.

Structure the page with [[_TOC_]], then keep it true

The [[_TOC_]] macro renders a table of contents from the page headings, which suits a long architecture page: one section per subsystem, each anchored by a heading, each carrying its own diagram where needed.

Keeping those diagrams true is the real work. Datadef ships an MCP server (registry name io.datadef/mcp) so a connected agent can update the diagram from what it reads in the repository, invoked after a merge, from a scheduled pipeline, or on request. Datadef does not watch repositories; regeneration happens when an agent call or CI command asks for it. The agent authenticates with a key that paid plans carry. The embed itself requires the project to be shared public, and turns into a 404 if the project goes private. The wiki-wide version of this practice is covered in keep your internal wiki in sync.

FAQ

How do I embed a diagram in an Azure DevOps wiki?

Use markdown image syntax with an external URL, for example ![Architecture](https://datadef.io/api/embed/your-slug =900x). The =WIDTHxHEIGHT suffix is Azure DevOps specific and sets display size. Pointing the image at a live endpoint keeps the wiki page current, since the wiki fetches external images at view time.

Can I use an iframe in an Azure DevOps wiki?

Only for an allowlist of video providers such as YouTube and Microsoft Streams. Iframes pointing at arbitrary pages, including interactive diagram embeds, do not render. Use a live image linked to the full diagram page instead.

What Mermaid version does the Azure DevOps wiki support?

The wiki runs Mermaid 8.13.9 inside ::: mermaid fences, with sequence, flowchart (as graph), Gantt, class, and state diagrams supported. Experimental types at that version, including entity relationship and git graph, are excluded, and syntax from recent Mermaid docs often fails on the older version.

How do I resize an image in an Azure DevOps wiki?

Append =WIDTHxHEIGHT after the image URL inside the parentheses: ![alt](https://example.com/image.png =600x400). Height can be omitted, as in =600x. This is display sizing; the underlying image is unchanged.

What is the difference between a project wiki and a code wiki for diagrams?

A project wiki is provisioned and edited through the web UI; a code wiki publishes markdown folders from a repo you own, so pages go through your PR flow. The image markdown is identical in both. Code wikis pair better with CI-driven diagram regeneration because the docs and the code share a pipeline.

Does an embedded diagram update automatically in the wiki?

The image follows the source diagram: it is served with a five minute cache lifetime, so an edit shows up within minutes without touching the wiki page. The diagram edit itself is not automatic; a person or a connected agent makes it when the architecture changes.