<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vignesh Athiappan</title>
    <description>The latest articles on DEV Community by Vignesh Athiappan (@vicky_acedia).</description>
    <link>https://dev.to/vicky_acedia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4028899%2F1e712c2d-9953-4fd8-855f-a0bdd45cb21b.jpeg</url>
      <title>DEV Community: Vignesh Athiappan</title>
      <link>https://dev.to/vicky_acedia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vicky_acedia"/>
    <language>en</language>
    <item>
      <title>Treat Your AI Agents Like Code - GitOps for Azure AI Foundry Agents</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Thu, 12 Nov 2026 13:01:35 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/treat-your-ai-agents-like-code-gitops-for-azure-ai-foundry-agents-5a7k</link>
      <guid>https://dev.to/vicky_acedia/treat-your-ai-agents-like-code-gitops-for-azure-ai-foundry-agents-5a7k</guid>
      <description>&lt;p&gt;If your team builds AI agents in &lt;strong&gt;Azure AI Foundry&lt;/strong&gt;, you have probably lived this story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Someone tweaks a prompt in the portal "just to test something".&lt;/li&gt;
&lt;li&gt;A week later the agent behaves differently and nobody knows why.&lt;/li&gt;
&lt;li&gt;There is no history, no review and no easy way back.&lt;/li&gt;
&lt;li&gt;The "dev" agent and the "prod" agent quietly drifted apart months ago.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prompts, model choices, temperatures and tool definitions &lt;strong&gt;are code&lt;/strong&gt;. They change behaviour in production just as much as a line of TypeScript does. So we started treating them that way.&lt;/p&gt;

&lt;p&gt;This post walks through the setup: one Git repo as the single source of truth for every agent across several Foundry projects, where &lt;strong&gt;the only way to change production is a reviewed pull request&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Every agent is a folder of plain files. A change reaches Foundry only through a reviewed PR. Completing the PR deploys it automatically. The PR review &lt;em&gt;is&lt;/em&gt; the approval.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it. Everything else is tooling that makes this safe and painless.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Every agent is a folder
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;projects.json                     the Foundry projects: endpoint, API version, notes
projects/
  support-prod/                   one folder per Foundry project
    agents/
      HELPDESK-AGENT/             folder name = the agent name in Foundry, exactly
        instructions.md           the prompt, word for word
        agent.json                model, temperature, tools, description, metadata
    in-use.json                   optional: agents an app still depends on
scripts/  pipelines/  schemas/    shared by every project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why split &lt;code&gt;instructions.md&lt;/code&gt; from &lt;code&gt;agent.json&lt;/code&gt;?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prompts are prose.&lt;/strong&gt; Reviewing a prompt change as a clean Markdown line diff is far nicer than reviewing an escaped string inside JSON.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Config is structure.&lt;/strong&gt; Model, temperature, reasoning effort and tool definitions (including full OpenAPI specs) live in JSON and are validated against a schema.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A trimmed &lt;code&gt;agent.json&lt;/code&gt; looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"definition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"gpt-5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"reasoning"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"effort"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"low"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"tools"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"web_search"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"openapi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"openapi"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"tickets_api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"spec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"servers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://api.example.com?subscription-key={{secret:TICKETS_API_KEY}}"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Answers employee IT questions and opens tickets."&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the &lt;code&gt;{{secret:...}}&lt;/code&gt; placeholder. More on that below.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Rules checked on every PR
&lt;/h2&gt;

&lt;p&gt;A JSON Schema plus a small validator catch the mistakes that otherwise only show up as a cryptic API error during deploy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kind&lt;/code&gt; must be &lt;code&gt;prompt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Reasoning models (gpt-5, o-series) take &lt;strong&gt;no&lt;/strong&gt; &lt;code&gt;temperature&lt;/code&gt; / &lt;code&gt;top_p&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;description&lt;/code&gt; ≤ 500 characters; OpenAPI tool &lt;code&gt;description&lt;/code&gt; ≤ 4000 characters.&lt;/li&gt;
&lt;li&gt;Every project folder must exist in &lt;code&gt;projects.json&lt;/code&gt;, and the deploy pipeline's project list must match it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fail fast in the PR, not at 6 pm during a release.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Secrets never touch Git
&lt;/h2&gt;

&lt;p&gt;Agents that call APIs often carry keys inside OpenAPI server URLs or headers. Committing those is a disaster, so the tooling &lt;strong&gt;redacts on the way in and restores on the way out&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When an agent is pulled from Foundry, every secret-looking value (&lt;code&gt;subscription-key=&lt;/code&gt;, &lt;code&gt;sig=&lt;/code&gt;, &lt;code&gt;key=&lt;/code&gt;, &lt;code&gt;code=&lt;/code&gt;, API-key headers...) is replaced with a placeholder like &lt;code&gt;{{secret:TICKETS_API_KEY}}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The placeholder name is derived from &lt;strong&gt;where the key is used&lt;/strong&gt; (host + parameter). The same key always gets the same name, even after it's rotated.&lt;/li&gt;
&lt;li&gt;At deploy time, each placeholder gets the value the agent &lt;strong&gt;already has in live Foundry&lt;/strong&gt;. A brand-new agent gets the value other agents in the same project use.&lt;/li&gt;
&lt;li&gt;Need to rotate or introduce a new key? Add a pipeline secret variable &lt;code&gt;SECRET_&amp;lt;NAME&amp;gt;&lt;/code&gt;; it wins over the live value.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;secret scanner&lt;/strong&gt; runs on every PR and every backup. If anything secret-looking survives, the run fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The nice side effect: &lt;strong&gt;no extra secret store needed.&lt;/strong&gt; Live Foundry already holds the values; the repo just holds the shape.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. The developer workflow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; edit files  /  import from a sandbox project
        │
        ▼
 commit to dev branch ──► PR to prod branch ──► PR check comments the Foundry diff
                                   │
                           reviewer completes it
                                   │
                                   ▼
               Deploy pipeline starts on its own (merge trigger)
               safety backup → preview → apply → read back &amp;amp; verify
                                   │
                                   ▼
                      agent is live in its Foundry project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are three ways a change starts:&lt;/p&gt;

&lt;h3&gt;
  
  
  A. You built a new agent in the portal
&lt;/h3&gt;

&lt;p&gt;Building in the portal is still great for experimenting. So keep doing that, &lt;strong&gt;in a sandbox project&lt;/strong&gt;. When it's ready, run an &lt;strong&gt;Import&lt;/strong&gt; pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pick the source project and agent name,&lt;/li&gt;
&lt;li&gt;pick the target project (and optionally a new name),&lt;/li&gt;
&lt;li&gt;tick &lt;em&gt;dry run&lt;/em&gt; the first time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pipeline copies the agent into &lt;code&gt;projects/&amp;lt;target&amp;gt;/agents/&amp;lt;NAME&amp;gt;/&lt;/code&gt;, commits to the dev branch and &lt;strong&gt;opens the PR for you&lt;/strong&gt;. Its summary warns about things that don't travel between projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚠️ a secret the target project doesn't have yet,&lt;/li&gt;
&lt;li&gt;❌ a connection (MCP server, AI Search index) that doesn't exist in the target,&lt;/li&gt;
&lt;li&gt;⚠️ uploaded files / vector store IDs, which belong to the source project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Changed it again in the sandbox? Re-run the import; the PR shows only what changed.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. You edit the files directly
&lt;/h3&gt;

&lt;p&gt;Branch, edit &lt;code&gt;instructions.md&lt;/code&gt; or &lt;code&gt;agent.json&lt;/code&gt;, run the local checks, push, open a PR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci
npm &lt;span class="nb"&gt;test&lt;/span&gt;
npm run validate
npm run scan
npm run diff -- --project support-prod --agents HELPDESK-AGENT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. You delete an agent
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;First&lt;/strong&gt; repoint or switch off the agent in whatever app calls it.&lt;/li&gt;
&lt;li&gt;Delete the folder in a PR.&lt;/li&gt;
&lt;li&gt;Deploy refuses to delete anything listed in the project's &lt;code&gt;in-use.json&lt;/code&gt;, which is a cheap but very effective seatbelt.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Foundry has no rename. A rename is two PRs: add the new folder, repoint the app, then remove the old folder.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  5. The PR check: a human-readable Foundry diff
&lt;/h2&gt;

&lt;p&gt;This is my favourite part. On every PR, a pipeline compares the files against &lt;strong&gt;live Foundry&lt;/strong&gt; and posts a comment like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;support-prod / HELPDESK-AGENT   (update)
  model:        gpt-4.1  →  gpt-5
  temperature:  0.7      →  (removed, reasoning model)
  instructions: +6 −2 lines
  tools:        + web_search
                ~ tickets_api (spec changed)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reviewers see &lt;strong&gt;exactly what will change in production&lt;/strong&gt;, not just which files changed. It sends nothing to Foundry; it only reads.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Merge = deploy
&lt;/h2&gt;

&lt;p&gt;When the reviewer completes the PR into the prod branch, a merge trigger starts the deploy pipeline automatically. In Azure DevOps that is just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;            &lt;span class="c1"&gt;# your protected prod branch
&lt;/span&gt;  &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;projects/*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The deploy runs in &lt;code&gt;auto&lt;/code&gt; mode over every agent folder the merge touched, in every project:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Folder change&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;new folder&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;create&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;changed folder&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;update&lt;/strong&gt; (Foundry adds a new version)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;removed folder&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;delete&lt;/strong&gt; (always last)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each run:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Takes a safety backup&lt;/strong&gt; of the project first. No backup, no deploy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Previews&lt;/strong&gt; the plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Applies&lt;/strong&gt; the changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reads every agent back&lt;/strong&gt; and fails if Foundry doesn't match the files.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If any agent in a project is blocked (missing secret, missing connection, protected by &lt;code&gt;in-use.json&lt;/code&gt;), &lt;strong&gt;nothing&lt;/strong&gt; is sent to that project. All or nothing per project.&lt;/p&gt;

&lt;p&gt;Rolling back? Revert the PR. The revert merges, and the same pipeline deploys the previous version.&lt;/p&gt;

&lt;p&gt;A couple of guardrails worth copying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scripts only write to Foundry with &lt;code&gt;--apply&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; an environment variable that only the deploy pipeline sets. You physically can't deploy from a laptop by accident.&lt;/li&gt;
&lt;li&gt;Deploy runs only from the protected branch, so it can only ship what a reviewed PR put there.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. Nightly backups and drift detection
&lt;/h2&gt;

&lt;p&gt;People will still occasionally edit in the portal. Rather than pretending they won't, we detect it.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;backup pipeline&lt;/strong&gt; runs every night and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;discovers every Foundry project&lt;/strong&gt; in the subscription automatically, so a project created today is backed up tonight with no code change,&lt;/li&gt;
&lt;li&gt;snapshots every agent (secrets redacted) to a separate &lt;strong&gt;&lt;code&gt;foundry-backup&lt;/code&gt; branch&lt;/strong&gt;, never to the prod branch, so a merged-but-not-yet-deployed change is never overwritten,&lt;/li&gt;
&lt;li&gt;publishes the snapshot as a pipeline artifact,&lt;/li&gt;
&lt;li&gt;reports &lt;strong&gt;drift&lt;/strong&gt;: agents whose live version differs from the files in the prod branch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Drift means one of two things: a deploy that failed or was blocked, or a portal edit. The next deploy overwrites portal edits; if you want to keep one, copy it from the backup branch into a PR.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. The four pipelines at a glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pipeline&lt;/th&gt;
&lt;th&gt;Triggered by&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Writes to Foundry?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Import&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;developer&lt;/td&gt;
&lt;td&gt;copies an agent from a sandbox project into the repo and opens the PR&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PR Check&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;every PR into prod&lt;/td&gt;
&lt;td&gt;tests, secret scan, schema checks, comments the Foundry diff&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deploy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;PR completed (or manual)&lt;/td&gt;
&lt;td&gt;safety backup → preview → apply → read-back verify&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;yes&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backup&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;nightly schedule&lt;/td&gt;
&lt;td&gt;snapshots every agent of every project, reports drift&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Only one of the four can write, and it only runs from the protected branch.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. One-time setup checklist
&lt;/h2&gt;

&lt;p&gt;If you want to build something similar, here's what it took on the platform side:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Branches&lt;/strong&gt;: a dev branch for the team and a protected prod branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity&lt;/strong&gt;: give the pipeline's service connection the &lt;strong&gt;Foundry User&lt;/strong&gt; role (formerly &lt;em&gt;Azure AI User&lt;/em&gt;), ideally once at subscription scope so new projects are covered automatically. Note that an identity can't grant itself access, so someone with role-assignment rights does this once by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipelines&lt;/strong&gt;: Import, PR Check, Deploy, Backup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch policy on prod&lt;/strong&gt;: require a PR, at least one reviewer, and the PR Check as required build validation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build service permissions&lt;/strong&gt;: contribute only to the backup branch, plus permission to comment on PRs. No bypass policies anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent pool&lt;/strong&gt;: must reach every Foundry endpoint, with Node, git and the Azure CLI available.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What we gained
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every prompt change is reviewed&lt;/strong&gt; and has an author, a reason and a date.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rollback is a revert&lt;/strong&gt;, not an archaeology session in the portal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dev and prod can't silently drift&lt;/strong&gt;, and when they do, the nightly report tells you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets stay out of Git&lt;/strong&gt; without adding another secret store.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Promoting an agent&lt;/strong&gt; from a sandbox to production is one pipeline run and one PR.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Split prose from config.&lt;/strong&gt; Reviewing prompts as Markdown diffs changes how carefully people read them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show the production diff, not the file diff.&lt;/strong&gt; Reviewers care about "model goes from X to Y", not about which JSON key moved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make the deploy verify itself.&lt;/strong&gt; Reading every agent back after writing caught real issues that "HTTP 200" did not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Back up before every write.&lt;/strong&gt; It's cheap and it turns scary deploys into boring ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assume portal edits will happen.&lt;/strong&gt; Detect drift instead of hoping for discipline.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;AI agents are quickly becoming production software. Giving them the same boring, reliable engineering practices as the rest of your stack — version control, code review, CI checks, automated deploys and backups — is one of the highest-leverage things you can do.&lt;/p&gt;

&lt;p&gt;If you're running agents in Azure AI Foundry (or any agent platform with an API), I'd love to hear how you manage them. Drop a comment below! 👇&lt;/p&gt;

</description>
      <category>ai</category>
      <category>azure</category>
    </item>
    <item>
      <title>From RAG Pipeline to RAG Tool: Building an Agentic Sales Knowledge Assistant</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Fri, 06 Nov 2026 10:54:51 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/from-rag-pipeline-to-rag-tool-building-an-agentic-sales-knowledge-assistant-56jp</link>
      <guid>https://dev.to/vicky_acedia/from-rag-pipeline-to-rag-tool-building-an-agentic-sales-knowledge-assistant-56jp</guid>
      <description>&lt;p&gt;&lt;em&gt;Why I stopped bolting retrieval onto the prompt and started handing it to the agent as a tool.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem every sales team has
&lt;/h2&gt;

&lt;p&gt;Every services company has the same quiet problem. Over the years it writes hundreds of proposals, RFP responses, capability decks and case studies. Each one holds hard-won knowledge: how a similar deal was priced, which team was proposed, which accelerator was used, what the client actually asked for.&lt;/p&gt;

&lt;p&gt;Almost none of it can be found when it's needed.&lt;/p&gt;

&lt;p&gt;It lives in SharePoint folders, Teams channels, email attachments and people's laptops. The person who wrote the winning proposal three years ago has moved on. A new bid starts from a blank page.&lt;/p&gt;

&lt;p&gt;The fix is a governed sales knowledge store. Every document is linked to a client, and to an opportunity or project when one is known. Every extracted fact is cited to the slide or page it came from. On top of that sits a chat assistant that salespeople can simply ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What did we propose for discovery on our last three banking RFPs, and where do those deals stand now?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They get a short answer with numbered sources that open the original document at the exact slide.&lt;/p&gt;

&lt;p&gt;This post covers the most important design decision behind that chat: &lt;strong&gt;don't build RAG as a pipeline. Build it as a tool.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Classic RAG: retrieval as a pipeline
&lt;/h2&gt;

&lt;p&gt;Most RAG systems in tutorials look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user question
   └─&amp;gt; embed question
        └─&amp;gt; vector search (top k chunks)
             └─&amp;gt; paste chunks into the prompt
                  └─&amp;gt; LLM writes the answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Retrieval happens once, before the model thinks, and always the same way. That works well for demos. In a real sales knowledge base it breaks quickly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One search is rarely enough.&lt;/strong&gt; "Compare our proposals for Client A and Client B" needs at least two searches with different filters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The question is not the best query.&lt;/strong&gt; "Where are we with them?" is a terrible search string. The model knows what it means. The pipeline doesn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some answers aren't in documents at all.&lt;/strong&gt; The current stage, value and close date of a deal live in the CRM, not in a PDF.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The pipeline can't recover.&lt;/strong&gt; If the first search returns nothing useful, the model is stuck answering from bad context, or worse, from its own imagination.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Agentic RAG: retrieval as a tool
&lt;/h2&gt;

&lt;p&gt;So turn the retrieval step inside out. Instead of the application deciding what to retrieve and when, give the agent a function, &lt;code&gt;search_sales_knowledge&lt;/code&gt;, and let it decide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user question
   └─&amp;gt; Agent (LLM on an agent runtime)
         ├─ thinks: "I need the proposals for this client"
         ├─ calls search_sales_knowledge("client X discovery phase", brand_id=…)
         │      └─&amp;gt; API runs hybrid search, returns numbered sources [1]…[8]
         ├─ thinks: "one proposal is linked to an opportunity, check where it stands"
         ├─ calls crm_opportunity_details(opportunity_id)
         │      └─&amp;gt; API reads the CRM (read only), returns source [9]
         ├─ thinks: "results are thin for the second client, rephrase"
         ├─ calls search_sales_knowledge("client Y cloud migration proposal")
         └─ writes the answer, citing [n] after every fact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tool definition is a plain OpenAI-style function schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chatSearchToolDefinition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;function&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;function&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;search_sales_knowledge&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Search the sales knowledge store (document sections, extracted facts and account knowledge pages). Returns numbered sources; cite them as [ref].&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;object&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;What to look for, in plain words.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;         &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;integer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;How many sources to return (1-15, default 8).&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;item_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Only items of one type (e.g. case studies).&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;brand_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Only sources linked to one CRM account.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;accelerator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Only items that name this accelerator.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;offering&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Only items that name this offering.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;query&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next to it, the agent gets a small set of read-only CRM tools: search accounts, account details, search opportunities, opportunity details, recent activities, pipeline totals, and wins and losses. That lets the agent combine two kinds of truth in one answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What was said&lt;/strong&gt; (proposals, decks, case studies, sales updates) comes from the knowledge store.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where the deal stands now&lt;/strong&gt; (stage, value, owner, close date) comes from the live CRM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent is told to use at most six tool calls per question, to search again with different words when the first results don't answer the question, and to say plainly when the store doesn't cover something.&lt;/p&gt;

&lt;h2&gt;
  
  
  A detail that matters: the tool runs in your code
&lt;/h2&gt;

&lt;p&gt;Foundry Agents can attach Azure AI Search directly as a built-in tool. I deliberately didn't do that. The search tool is a client-side function. The agent run streams back a &lt;code&gt;requires_action&lt;/code&gt; event, the API executes the search itself, and it submits the results back into the same stream.&lt;/p&gt;

&lt;p&gt;That one choice gives the application, not the model, control over every retrieval:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Guard&lt;/th&gt;
&lt;th&gt;What the tool handler enforces, regardless of what the model asks for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Active categories only&lt;/td&gt;
&lt;td&gt;Retired categories never come back, even if they're still in the index.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discontinued / deleted docs&lt;/td&gt;
&lt;td&gt;Excluded by ID on every search.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Internal-only values&lt;/td&gt;
&lt;td&gt;Facts found only in speaker notes stay hidden unless the category allows them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scoped questions&lt;/td&gt;
&lt;td&gt;If the user scoped the chat to a client or to specific documents, that filter is forced in and the model can't widen it. CRM tools are switched off for document-scoped questions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Related accounts&lt;/td&gt;
&lt;td&gt;A client is often several CRM accounts. A filtered search is interleaved one-for-one with the same search unfiltered, so sibling accounts' sources are never missed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Budget&lt;/td&gt;
&lt;td&gt;Arguments are validated and clamped (&lt;code&gt;top&lt;/code&gt; between 1 and 15).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The model chooses what to look for. The application decides what it's allowed to see.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Retrieval itself: hybrid, filtered, semantic
&lt;/h2&gt;

&lt;p&gt;Behind the tool is Azure AI Search with a single index for the whole store. Every search is hybrid:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keyword search (BM25)&lt;/strong&gt; on the chunk title and text. This is good for client names, product names and acronyms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector search (HNSW)&lt;/strong&gt; with the question embedded by the same model used for the documents (&lt;code&gt;text-embedding-3-large&lt;/code&gt;). This is good for meaning, so "cost reduction" finds "lower TCO".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic re-ranking&lt;/strong&gt; on top, when available. If the semantic ranker refuses (for example, because the free quota is used up), the search silently falls back to plain hybrid for ten minutes instead of failing the user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of it runs under an OData filter built from the guards above. Every chunk also carries filterable facets: account IDs, opportunity IDs, project IDs, category, item type, and tags for industry, client, technology, service line, offering, accelerator, partner and named people.&lt;/p&gt;

&lt;p&gt;Every hit records where it came from: the document ID, the slide or page and its number, and a deep link into the in-app viewer. That's what makes a citation clickable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Citations you can trust
&lt;/h2&gt;

&lt;p&gt;An agent that cites is only useful if the citations are real. This is enforced in two places.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At answer time.&lt;/strong&gt; Every search result gets a reference number in a per-answer source book. The same chunk keeps the same number if a later search finds it again, so the agent can cite across several tool calls. When the answer is finished, a final pass does four things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It removes any &lt;code&gt;[n]&lt;/code&gt; that points at nothing the tools returned, so there is never a citation without a source.&lt;/li&gt;
&lt;li&gt;It renumbers the rest 1..k in order of first use.&lt;/li&gt;
&lt;li&gt;It merges chunks of the same slide into one source for the reader.&lt;/li&gt;
&lt;li&gt;It stores the answer with its citation list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;At ingestion time.&lt;/strong&gt; This is the bigger story.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other half: a governed ingestion pipeline
&lt;/h2&gt;

&lt;p&gt;Agentic retrieval is only as good as what it retrieves. Garbage in means confidently cited garbage out. So the write side is the opposite of agentic. It's a strict, deterministic pipeline where the model is only ever a helper and code makes every decision that matters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upload / SharePoint folder / Teams channel / API feed
  └─&amp;gt; store original privately, queue a job (Azure Service Bus)
       └─&amp;gt; convert to PDF (LibreOffice), read layout per page (Document Intelligence)
            └─&amp;gt; CLASSIFY  - does this document belong to its category? (refuse if confident it doesn't)
            └─&amp;gt; MAP       - which sections feed which fields?
            └─&amp;gt; EXTRACT   - strict JSON {field: {value, citations[]}} per field group
            └─&amp;gt; CHECK     - code verifies every citation: the snippet must exist on that slide/page
            └─&amp;gt; LINK      - client, opportunity, project scored against CRM masters (never guessed)
            └─&amp;gt; DEDUP     - same identity → new version of the same row; same bytes → blocked
            └─&amp;gt; WRITE     - row, fields, citations, Markdown file, history: one transaction
            └─&amp;gt; INDEX     - sections, facts and items chunked, embedded, pushed to AI Search
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few rules make this trustworthy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every extracted value has a citation that code has checked.&lt;/strong&gt; The model must return a snippet and a page number. Code then looks for that snippet on that page. If it isn't there (or is only on a different page, which gets corrected), the value isn't stored and the field is marked &lt;em&gt;needs review&lt;/em&gt;. The model can't invent a fact into the store.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never guess an ID.&lt;/strong&gt; Links to clients and opportunities are scored on stated evidence only: names, dates, values, people, and distinctive words from the CRM description. Only a clear winner, with a high score and a wide margin over the runner-up, links automatically, and the evidence is recorded. Otherwise a human decides.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One document, one row.&lt;/strong&gt; A document's identity is its category, client, opportunity and normalized file name, with "v4", "final", "draft" and "(1)" stripped. Upload a new version and the same row is updated in place, with the previous version archived. Upload the exact same bytes again and nothing is written.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Final versions only.&lt;/strong&gt; Drafts and working copies are refused with a reason.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No personal data.&lt;/strong&gt; Personal phone numbers and private emails never appear in any stored value, snippet or Markdown file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An append-only history.&lt;/strong&gt; Every create, overwrite, block, retag, delete and index event is recorded, and the database itself denies updates to that history.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is that when the agent cites "[3] Proposal, slide 14", there is a verified chain behind it. The slide exists, the text is on it, the document is the final version, and it's linked to the right client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a category is data, not code
&lt;/h2&gt;

&lt;p&gt;The store started with a single category, RFP proposals. It grew to hold RFP packs, supporting documents (meeting transcripts, clarifications), sales leadership updates fed from an API, capability decks, case studies and executive playbooks.&lt;/p&gt;

&lt;p&gt;None of these added a new code path. A category is rows in three tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;category&lt;/code&gt;&lt;/strong&gt; holds its name, its rules (client required? opportunity required?), and whether it has items.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;category_field&lt;/code&gt;&lt;/strong&gt; holds what its fields mean, their group, description and type. The extraction prompt is built from this list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;category_prompt&lt;/code&gt;&lt;/strong&gt; holds versioned classify, map and extract prompts, with one active per stage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The chat agent's instructions work the same way. The list of what the store holds is injected from the active categories at sync time, so the agent definition never names a category.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack, briefly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Language and runtime:&lt;/strong&gt; TypeScript (strict) everywhere, Node 24 and ESM, in one monorepo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;packages/core&lt;/code&gt;:&lt;/strong&gt; the only place business rules live. The API, worker and CLI all call it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;apps/api&lt;/code&gt;:&lt;/strong&gt; a Fastify REST API that never does long work inside a request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;apps/worker&lt;/code&gt;:&lt;/strong&gt; queue workers for the pipeline, media, feeds and schedules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;apps/web&lt;/code&gt;:&lt;/strong&gt; Angular with Entra sign-in, usable on a phone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure:&lt;/strong&gt; Microsoft Foundry (an LLM for extraction and chat, &lt;code&gt;text-embedding-3-large&lt;/code&gt; for vectors, Foundry Agents for the chat runtime), Azure AI Search, Document Intelligence, Service Bus and Blob Storage. Everything is reached with managed identity via &lt;code&gt;DefaultAzureCredential&lt;/code&gt;, with no keys in code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; SQL Server for the governed store, with numbered forward-only migrations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Make retrieval a tool, but keep the tool in your code.&lt;/strong&gt; The model is much better than a fixed pipeline at deciding what to search and whether to search again. The application is much better at deciding what may be returned. A client-side function tool gives you both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Give the agent more than one source of truth.&lt;/strong&gt; Documents tell you what was said. The CRM tells you what's true now. The questions salespeople actually ask need both, and an agent with two kinds of tools combines them naturally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Citations are a contract, not a prompt instruction.&lt;/strong&gt; Asking the model to cite isn't enough. Verify citations against the source at ingestion, and drop unknown references at answer time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Go agentic on the read side and deterministic on the write side.&lt;/strong&gt; Let the model explore freely when answering, because nothing it does there changes data. Let it do nothing on its own when storing, because everything stored is trusted later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Put the variety in data.&lt;/strong&gt; Six categories in, the pipeline, index and chat are still the same code. That's what keeps a system like this small enough to stay governed.&lt;/p&gt;

&lt;h2&gt;
  
  
  In one sentence
&lt;/h2&gt;

&lt;p&gt;A governed, cited knowledge store turns years of scattered proposals into something searchable. An agent that treats retrieval as a tool can then choose its own queries, combine documents with live CRM data, and never state a fact it can't point to.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Questions and feedback welcome in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>azure</category>
    </item>
    <item>
      <title>Building a Live Azure Exposure Dashboard with Zero npm Dependencies</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Mon, 19 Oct 2026 13:35:05 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/building-a-live-azure-exposure-dashboard-with-zero-npm-dependencies-1n7</link>
      <guid>https://dev.to/vicky_acedia/building-a-live-azure-exposure-dashboard-with-zero-npm-dependencies-1n7</guid>
      <description>&lt;p&gt;Every cloud team eventually needs a quick answer to one question: &lt;strong&gt;is our Azure estate exposed or broken right now, and how badly?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually that answer comes from a mix of Defender for Cloud alerts, tribal knowledge, and a few &lt;code&gt;az&lt;/code&gt; commands run during an incident. I wanted something continuous, so I designed a read-only dashboard. It reads Azure configuration on a timer, probes live endpoints from the internet, checks everything against rules, scores it, and streams the result to the browser.&lt;/p&gt;

&lt;p&gt;Here's how it works and the design decisions behind it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with one request path
&lt;/h2&gt;

&lt;p&gt;A typical locked-down web workload on Azure looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User → Front Door (WAF) → Private Link → App Service → VNet integration → SQL Managed Instance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tracing that path by hand with &lt;code&gt;az&lt;/code&gt; commands is slow. It also shows how easy it is for one link in the chain to quietly drift. The usual misconfigurations in a setup like this are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;WAF in Detection mode&lt;/strong&gt;, which logs attacks but doesn't block them&lt;/li&gt;
&lt;li&gt;Apps still reachable &lt;strong&gt;directly on &lt;code&gt;*.azurewebsites.net&lt;/code&gt;&lt;/strong&gt;, bypassing Front Door and the WAF&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VNet peerings&lt;/strong&gt; or &lt;strong&gt;private endpoints&lt;/strong&gt; in a disconnected state&lt;/li&gt;
&lt;li&gt;PaaS services with &lt;strong&gt;public network access&lt;/strong&gt; still enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these cause errors. Everything keeps working, and that's what makes them dangerous. So the goal is to automate the trace for &lt;em&gt;every&lt;/em&gt; app and resource, re-check it continuously, and make any gap visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it checks
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;What is checked&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;App Services&lt;/strong&gt; (Web, Functions, Logic App Standard)&lt;/td&gt;
&lt;td&gt;The full chain per app: custom domain, TLS, HTTPS redirect, WAF attached and in Prevention mode, health probe, Private Link approved, public access locked, SCM/Kudu restricted, FTP disabled, managed identity, VNet integration with route-all, and NSG reachability to SQL MI on 1433 and 11000–11999&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Live probes&lt;/strong&gt; (every 20s)&lt;/td&gt;
&lt;td&gt;Custom domain through Front Door must answer. The direct &lt;code&gt;*.azurewebsites.net&lt;/code&gt; URL must be &lt;strong&gt;blocked&lt;/strong&gt;. DNS CNAME must point to &lt;code&gt;azurefd.net&lt;/code&gt;. SQL MI hostname must resolve to a private IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PaaS resources&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Storage, API Management, Logic Apps, Redis, Azure OpenAI / AI Services, AI Search, Service Bus, Key Vault, Cosmos DB, Azure SQL, SQL MI. Checks cover public access, private endpoints, TLS, local/key auth, soft delete, purge protection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Network&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;NSG rules open to the internet, subnets without an NSG, peerings not Connected, private endpoints not Approved, private DNS zones not linked to any VNet&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The live probes are the part I'd recommend to anyone building something like this. &lt;strong&gt;Configuration tells you what &lt;em&gt;should&lt;/em&gt; happen; probes tell you what &lt;em&gt;does&lt;/em&gt; happen.&lt;/strong&gt; An app can look locked down in ARM and still answer on its default hostname.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────── Browser (Angular 21) ────────────┐
│ Dashboard · Apps · Resources · Network ·     │
│ Topology · Admin · Preferences               │
└───────────────┬──────────────────────────────┘
                │ HTTPS + Server-Sent Events
┌───────────────▼──────────────────────────────┐
│ Server (Node.js, zero npm dependencies)      │
│  auth      → Entra ID SSO + sessions         │
│  collect   → ARM snapshot (GET only)         │
│  checks    → rules &amp;amp; scoring                 │
│  probes    → live HTTPS / DNS                │
│  store     → JSON files                      │
└──────┬─────────────────────┬─────────────────┘
       │ read-only GETs      │ GET / DNS lookups
       ▼                     ▼
 Azure Resource Manager   Public internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server has &lt;strong&gt;no npm dependencies&lt;/strong&gt;. It uses only Node's built-in &lt;code&gt;http&lt;/code&gt;, &lt;code&gt;crypto&lt;/code&gt;, &lt;code&gt;dns&lt;/code&gt; and &lt;code&gt;fetch&lt;/code&gt;. For a security tool, keeping the supply-chain surface small matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  The loop
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scan (every 120s):&lt;/strong&gt; Collect VNets, NSGs, private endpoints, private DNS zones, sites and their config, SQL MI, Front Door (routes, origins, custom domains, WAF policies) and every PaaS type across the selected subscriptions. &lt;strong&gt;GET requests only.&lt;/strong&gt; It never reads secrets or app settings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Probe (every 20s):&lt;/strong&gt; Real HTTPS and DNS calls, max 8 concurrent, keeping the last 40 results per endpoint for latency charts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluate:&lt;/strong&gt; Turn the snapshot and probe results into pass / warn / fail checks, then compute scores.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stream:&lt;/strong&gt; Push the new state to every open browser over &lt;strong&gt;Server-Sent Events&lt;/strong&gt;. No polling and no WebSocket library.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remember:&lt;/strong&gt; Store one estate-score point per minute for the trend line.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Adding a new PaaS resource type is a single entry in a checks table, which keeps it cheap to grow coverage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code layout
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server/
├── azure.mjs       ARM client: token, paging, throttling, subscription list
├── collect.mjs     multi-subscription snapshot
├── resources.mjs   per-resource-type checks (add a type = one entry)
├── catalog.mjs     check catalog, default rules, rule validation
├── checks.mjs      app chain model, network findings, scoring, topology
├── probes.mjs      live HTTPS / DNS probes
├── auth.mjs        Entra ID sign-in, session cookies, roles
├── store.mjs       JSON persistence + settings validation
└── index.mjs       HTTP server, routes, SSE, timers
web/                Angular 21 (standalone, signals, zoneless, lazy routes)
data/               git-ignored: settings, rules, history, auth config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Scoring that can't be gamed
&lt;/h2&gt;

&lt;p&gt;A naive pass-rate score lies. Ninety passing low-severity checks will hide one wide-open database. So the scoring works like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every check has a &lt;strong&gt;severity weight&lt;/strong&gt;: critical 10, high 6, medium 3, low 1.&lt;/li&gt;
&lt;li&gt;A pass earns the full weight, a warn earns 50%, and a fail earns 0.&lt;/li&gt;
&lt;li&gt;Score = earned ÷ possible × 100, then &lt;strong&gt;capped&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;at most &lt;strong&gt;49&lt;/strong&gt; if any &lt;em&gt;critical&lt;/em&gt; check fails&lt;/li&gt;
&lt;li&gt;at most &lt;strong&gt;79&lt;/strong&gt; if any &lt;em&gt;high&lt;/em&gt; check fails&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Category score = average across the items of that type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Estate score = average of the category scores&lt;/strong&gt;, so hundreds of Logic Apps can't drown out a couple of API Management instances.&lt;/li&gt;
&lt;li&gt;Grades: A ≥ 90, B ≥ 75, C ≥ 60, D ≥ 40, F below that.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The caps are the key design decision. One serious gap should pull the score down hard, and no amount of passing hygiene checks should make up for it. Admins can tune weights, caps and thresholds in the UI, and scores recalculate instantly without a rescan.&lt;/p&gt;

&lt;h2&gt;
  
  
  SSO without a client secret
&lt;/h2&gt;

&lt;p&gt;Sign-in goes through Microsoft Entra ID with an app registration configured as a &lt;strong&gt;single-page application&lt;/strong&gt;, so there's no client secret to manage.&lt;/p&gt;

&lt;p&gt;The flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The server redirects to Entra with &lt;code&gt;state&lt;/code&gt;, &lt;code&gt;nonce&lt;/code&gt; and a &lt;strong&gt;PKCE&lt;/strong&gt; challenge, and sets a short-lived signed "flow" cookie.&lt;/li&gt;
&lt;li&gt;After sign-in, Entra redirects back with an authorization code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The browser redeems the code&lt;/strong&gt;, because Entra only allows browser redemption for SPA redirect URIs.&lt;/li&gt;
&lt;li&gt;The browser posts the ID token to the server, which verifies the signature (JWKS), issuer, audience, tenant, expiry, nonce and state.&lt;/li&gt;
&lt;li&gt;The server sets an &lt;strong&gt;HMAC-signed, &lt;code&gt;HttpOnly&lt;/code&gt;, &lt;code&gt;SameSite=Lax&lt;/code&gt; session cookie&lt;/strong&gt; that lasts 8 hours and is &lt;code&gt;Secure&lt;/code&gt; over HTTPS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Other hardening:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every page and API route requires a session, apart from the sign-in routes&lt;/li&gt;
&lt;li&gt;Cross-origin writes are blocked&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;returnTo&lt;/code&gt; links can only point inside the app, so it can't be used as an open redirect&lt;/li&gt;
&lt;li&gt;If a client secret is ever configured, the server switches to the classic server-side flow automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A design point worth stressing:&lt;/strong&gt; if an app registration doesn't require user assignment, &lt;em&gt;anyone in the tenant can sign in&lt;/em&gt;. For a dashboard that lists your weak spots, that's not acceptable. Use a &lt;strong&gt;dedicated app registration&lt;/strong&gt; with assignment required and proper app roles (for example an &lt;code&gt;Admin&lt;/code&gt; role), or at minimum an explicit viewer allow-list.&lt;/p&gt;

&lt;h2&gt;
  
  
  The frontend
&lt;/h2&gt;

&lt;p&gt;Angular 21 with standalone components, signals, zoneless change detection and lazy routes. The main pages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dashboard:&lt;/strong&gt; estate score and trend, critical/high failures, live outages, Front Door bypasses, top problems grouped by rule&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App Services:&lt;/strong&gt; each app's chain shown as cards. Click a stage to filter its checks, each with its fix&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resources:&lt;/strong&gt; PaaS resources by type, with per-resource checks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Topology:&lt;/strong&gt; Front Door profiles and WAF mode, VNets → subnets → apps and private endpoints, NSG tables with flagged rules highlighted&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Admin:&lt;/strong&gt; editable scoring rules (read-only for viewers) and scan settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Signals and SSE pair well. The stream updates one signal, and the whole UI follows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosting: where you probe from matters
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Local&lt;/th&gt;
&lt;th&gt;Hosted&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Azure access&lt;/td&gt;
&lt;td&gt;&lt;code&gt;az login&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;App Service &lt;strong&gt;managed identity&lt;/strong&gt; with the &lt;strong&gt;Reader&lt;/strong&gt; role&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;local &lt;code&gt;data/&lt;/code&gt; folder&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/home/data&lt;/code&gt; (persists across restarts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Size&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;One Linux App Service, Always On, single instance&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two decisions worth calling out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reader is enough.&lt;/strong&gt; Every check reads configuration only. No data plane, no secrets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep it out of your VNets.&lt;/strong&gt; The probes need to test reachability &lt;em&gt;from the internet&lt;/em&gt;, the way an attacker would. Inside a VNet, private DNS gives answers that look reassuring but are misleading.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same applies when running locally: if you're on a network whose IPs are allow-listed somewhere, those resources will look "reachable" from your machine. &lt;strong&gt;The probe's vantage point is part of the test.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Known limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The SQL MI stage shows which instances an app &lt;em&gt;can&lt;/em&gt; reach on the network, not which database it actually uses. Confirming that would mean reading Key Vault, which is deliberately out of scope.&lt;/li&gt;
&lt;li&gt;Live state is held in memory, so it runs as a single instance.&lt;/li&gt;
&lt;li&gt;Only Front Door Standard/Premium is analysed, not classic Front Door.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Trace one request path by hand first.&lt;/strong&gt; It tells you exactly what to automate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Probe from the outside.&lt;/strong&gt; Configuration and reality drift apart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cap your scores.&lt;/strong&gt; Severity-weighted averages still hide critical gaps unless one failure can sink the score.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat a security dashboard as sensitive.&lt;/strong&gt; It's a map of your weak spots, so lock down who can sign in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero dependencies is achievable&lt;/strong&gt; on the server side for a tool like this, and it's worth it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you've built something similar, or you rely on Defender for Cloud or Azure Policy for this, I'd like to hear how you handle the live-probe side. Let me know in the comments.&lt;/p&gt;

</description>
      <category>azure</category>
    </item>
    <item>
      <title>Backing Up Azure API Management to Git with a Daily Pipeline</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Thu, 15 Oct 2026 04:30:00 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/backing-up-azure-api-management-to-git-with-a-daily-pipeline-54ja</link>
      <guid>https://dev.to/vicky_acedia/backing-up-azure-api-management-to-git-with-a-daily-pipeline-54ja</guid>
      <description>&lt;p&gt;Azure API Management is easy to change in the portal, and that's the problem. If your APIs and policies were built by hand, the only copy lives in Azure, and there's no "backup" button:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A deleted APIM instance is soft-deleted for 48 hours&lt;/strong&gt;, then purged with every API, policy and secret inside it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portal edits leave no history.&lt;/strong&gt; When a policy breaks, nobody can say what it looked like yesterday.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We wanted a daily copy we could trust, a history of every change, and a restore we had actually tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: Azure is the truth, Git is the time machine
&lt;/h2&gt;

&lt;p&gt;We didn't force a move to infrastructure-as-code. Azure stays the source of truth, and Git records what APIM looked like every morning.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Export exactly what Azure returns.&lt;/strong&gt; No templating, no clean-up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mirror, don't accumulate.&lt;/strong&gt; Deleted in Azure means deleted from the latest backup. Git history keeps every older version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit only on change.&lt;/strong&gt; Every commit is a real change worth looking at.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run in CI, not on a laptop.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bonus: the backup branch doubles as an &lt;strong&gt;audit log&lt;/strong&gt; for policies that never had version control.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the backup works
&lt;/h2&gt;

&lt;p&gt;One scheduled job:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check out the backup branch&lt;/strong&gt; into its own folder. Pipeline code lives on a separate tooling branch; backups live on a protected branch only the build identity can push to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extract APIM&lt;/strong&gt; with Microsoft's open-source &lt;a href="https://github.com/Azure/apiops" rel="noopener noreferrer"&gt;APIOps&lt;/a&gt; extractor, &lt;strong&gt;pinned to a fixed version&lt;/strong&gt;. It writes OpenAPI specs, policies, products, backends, named values, policy fragments and loggers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add &lt;code&gt;service.json&lt;/code&gt;&lt;/strong&gt; with the instance's own settings (tier, region, identity, network), because the extractor skips them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mirror with &lt;code&gt;rsync --delete&lt;/code&gt;&lt;/strong&gt; so deletions show up too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commit and push only if &lt;code&gt;git diff&lt;/code&gt; is non-empty.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Repo layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;APIM/&amp;lt;instance&amp;gt;/service.json
APIM/&amp;lt;instance&amp;gt;/policy.xml
APIM/&amp;lt;instance&amp;gt;/apis/&amp;lt;api&amp;gt;/specification.yaml, policy.xml, operations/…
APIM/&amp;lt;instance&amp;gt;/backends, named values, products, policy fragments, …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exporting needs only &lt;strong&gt;Reader&lt;/strong&gt; access. A morning check confirms the run started, every step passed and the push landed, and alerts if not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about secrets?
&lt;/h2&gt;

&lt;p&gt;Azure doesn't return secret values through its APIs, so they never reach Git. That's safe, but it means a backup alone can't bring them back.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;In the backup?&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Secret named values&lt;/td&gt;
&lt;td&gt;Name only&lt;/td&gt;
&lt;td&gt;Value is blank&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plain-text named values&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes, readable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plain text in Azure = plain text in Git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subscription keys&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Metadata only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keys typed directly into policies&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes, readable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Scan before the first commit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two takeaways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hunt for credentials stored as plain-text named values or hardcoded in policy XML.&lt;/strong&gt; Mark them secret in Azure, or accept the risk knowingly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat the backup repo as sensitive.&lt;/strong&gt; Restrict read access to a small group plus the build identity.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Restoring APIM
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A backup you've never restored is a hope, not a plan.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The restore pipeline is manual and &lt;strong&gt;defaults to dry run&lt;/strong&gt;: the first run only reports what it would do. It checks the target first and picks a path:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Target instance is…&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Soft-deleted (&amp;lt; 48h)&lt;/td&gt;
&lt;td&gt;Recovered in place&lt;/td&gt;
&lt;td&gt;Everything back: secrets, keys, identity, same URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Missing&lt;/td&gt;
&lt;td&gt;Re-created from &lt;code&gt;service.json&lt;/code&gt;, then published with the APIOps publisher&lt;/td&gt;
&lt;td&gt;APIs, policies, products, backends back; secrets partly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;td&gt;Backup published into it&lt;/td&gt;
&lt;td&gt;Same-named items overwritten, others untouched&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The trick: automatic secret refill
&lt;/h3&gt;

&lt;p&gt;If you front Logic Apps with APIM, most of your secret named values are the &lt;strong&gt;&lt;code&gt;sig&lt;/code&gt; keys&lt;/strong&gt; APIM stores when you import a Logic App as an API. The restore script:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads each operation's policy to find which Logic App trigger it calls.&lt;/li&gt;
&lt;li&gt;Asks that Logic App for its current callback URL, which gives back the &lt;code&gt;sig&lt;/code&gt; key.&lt;/li&gt;
&lt;li&gt;Repoints the APIM backend if the Logic App was re-created with a new URL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Application Insights logger keys are read from the App Insights resource the same way. In our dry run, this &lt;strong&gt;refilled about 80% of secrets automatically&lt;/strong&gt;. Most of the rest belonged to Logic Apps that no longer existed.&lt;/p&gt;

&lt;p&gt;If APIM fronts Logic Apps, &lt;strong&gt;restore the Logic Apps first&lt;/strong&gt;, so APIM can read their keys and URLs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What stays manual after a full rebuild
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Secrets with no source to read from (client secrets, partner keys)&lt;/li&gt;
&lt;li&gt;New subscription keys, which every caller has to receive&lt;/li&gt;
&lt;li&gt;Access for the new managed identity (Key Vault, storage, AI services)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  During an incident
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pause the daily backup.&lt;/strong&gt; It mirrors Azure, so a run after a deletion makes "latest" empty. Git history still has everything, but don't make recovery harder for yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use the vendor's tool.&lt;/strong&gt; Saving APIM is easy; restoring it in the right order (named values → backends → APIs → operations → policies → products) isn't. APIOps already solves that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin versions.&lt;/strong&gt; A newer extractor that formats files differently produces a giant diff that hides real changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know your recovery window.&lt;/strong&gt; 48 hours of soft-delete is your only safety net without a backup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document the gaps honestly.&lt;/strong&gt; Ours: single subscription only, non-production APIM tier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Think twice about delete locks.&lt;/strong&gt; A delete lock on APIM also blocks deleting anything &lt;em&gt;inside&lt;/em&gt; it, like an API or a named value, which gets in the way of everyday work.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checklist to build your own
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Dedicated repo with a tooling branch and a protected backup branch&lt;/li&gt;
&lt;li&gt;[ ] Service connection with &lt;strong&gt;Reader&lt;/strong&gt; for export (Contributor only if it also restores)&lt;/li&gt;
&lt;li&gt;[ ] Daily APIOps extraction (pinned) plus a &lt;code&gt;service.json&lt;/code&gt; export&lt;/li&gt;
&lt;li&gt;[ ] Mirror with deletions; commit only on change&lt;/li&gt;
&lt;li&gt;[ ] Scan the first export for plain-text secrets; restrict repo access&lt;/li&gt;
&lt;li&gt;[ ] Dry-run-first restore pipeline, run at least once&lt;/li&gt;
&lt;li&gt;[ ] Daily check that alerts when the backup didn't run or failed&lt;/li&gt;
&lt;li&gt;[ ] One-page runbook: restore order, what stays manual, who to call&lt;/li&gt;
&lt;li&gt;[ ] Rehearse a full restore into a throwaway resource group&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>azure</category>
    </item>
    <item>
      <title>Back Up Every Azure Logic App to Git, Automatically</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Wed, 14 Oct 2026 09:45:15 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/back-up-every-azure-logic-app-to-git-automatically-2k1a</link>
      <guid>https://dev.to/vicky_acedia/back-up-every-azure-logic-app-to-git-automatically-2k1a</guid>
      <description>&lt;p&gt;If your Logic Apps are edited in the Azure portal (and let's be honest, most are), production probably lives &lt;em&gt;only&lt;/em&gt; in the portal. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No history&lt;/strong&gt;: when a workflow breaks after an edit, you can't see what it looked like yesterday.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No undo for deletes&lt;/strong&gt;: a deleted Logic App is gone, definition and all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No source of truth&lt;/strong&gt;: your repo, if you have one, drifts from what's actually running.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't need a big infrastructure-as-code migration to fix this. You need a &lt;strong&gt;daily, automatic snapshot of what's really running&lt;/strong&gt;. Here's how I set one up in an afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup in one line
&lt;/h2&gt;

&lt;p&gt;A scheduled pipeline reads Azure and commits to a &lt;strong&gt;locked backup branch&lt;/strong&gt;. A second pipeline can restore any version from that branch. Both run from a separate, unprotected &lt;strong&gt;tooling branch&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets backed up
&lt;/h2&gt;

&lt;p&gt;Everything is saved exactly as Azure returns it, one folder per resource, so a Git diff shows exactly what someone changed in the portal.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Resource&lt;/th&gt;
&lt;th&gt;Repo path&lt;/th&gt;
&lt;th&gt;Exported via&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Consumption Logic Apps&lt;/td&gt;
&lt;td&gt;&lt;code&gt;LogicApps/&amp;lt;name&amp;gt;/workflow.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ARM REST API (one GET per workflow)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API connections&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ApiConnections/&amp;lt;name&amp;gt;/connection.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ARM REST API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API Management&lt;/td&gt;
&lt;td&gt;&lt;code&gt;APIM/&amp;lt;instance&amp;gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Microsoft's open-source APIOps extractor&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two details matter:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fetch each resource individually.&lt;/strong&gt; List calls can omit parts of the definition.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete folders for resources that no longer exist.&lt;/strong&gt; The latest commit mirrors Azure, while Git history keeps every older version.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Name clashes across resource groups get a &lt;code&gt;__&amp;lt;resource-group&amp;gt;&lt;/code&gt; suffix so nothing is overwritten.&lt;/p&gt;

&lt;h2&gt;
  
  
  The daily pipeline
&lt;/h2&gt;

&lt;p&gt;It runs on a Microsoft-hosted agent, so nobody's laptop needs to be on. Each run does four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the backup branch.&lt;/li&gt;
&lt;li&gt;Sign in with a &lt;strong&gt;Reader&lt;/strong&gt; service connection and export everything.&lt;/li&gt;
&lt;li&gt;Stage only the backup folders.&lt;/li&gt;
&lt;li&gt;Commit and push, but &lt;strong&gt;only if something changed&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;schedules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;30&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*'&lt;/span&gt;        &lt;span class="c1"&gt;# daily, 01:30 UTC&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;backup-tooling&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;always&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;              &lt;span class="c1"&gt;# run even if the repo hasn't changed&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;job&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Backup&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;checkout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;self&lt;/span&gt;        &lt;span class="c1"&gt;# tooling branch: scripts only&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;git -c http.extraheader="AUTHORIZATION&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bearer $SYSTEM_ACCESSTOKEN" clone --branch backup --single-branch "$(Build.Repository.Uri)" "$(backupDir)"&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;SYSTEM_ACCESSTOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$(System.AccessToken)&lt;/span&gt; &lt;span class="pi"&gt;}&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AzureCLI@2&lt;/span&gt;
        &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;azureSubscription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-reader-service-connection&lt;/span&gt;
          &lt;span class="na"&gt;scriptType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
          &lt;span class="na"&gt;scriptLocation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;inlineScript&lt;/span&gt;
          &lt;span class="na"&gt;inlineScript&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python3 sync/export.py --subscription "$(subscription)" --out "$(backupDir)"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;cd "$(backupDir)"&lt;/span&gt;
          &lt;span class="s"&gt;git add -A LogicApps ApiConnections APIM&lt;/span&gt;
          &lt;span class="s"&gt;git diff --cached --quiet &amp;amp;&amp;amp; { echo "No changes"; exit 0; }&lt;/span&gt;
          &lt;span class="s"&gt;git commit -m "Daily Azure backup $(date -u +%F) [skip ci]"&lt;/span&gt;
          &lt;span class="s"&gt;git push origin HEAD:backup&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two easy-to-miss settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;always: true&lt;/code&gt; makes the schedule fire even with no new commits.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[skip ci]&lt;/code&gt; stops the backup commit from triggering other pipelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Making the backup tamper-proof
&lt;/h2&gt;

&lt;p&gt;A backup anyone can delete isn't a backup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't use a branch lock.&lt;/strong&gt; A lock blocks everyone except the person who set it, including the pipeline's build identity, and "Bypass policies" doesn't override it.&lt;/p&gt;

&lt;p&gt;Use &lt;strong&gt;branch security&lt;/strong&gt; instead (Repos → Branches → ⋯ → Branch security):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Who&lt;/th&gt;
&lt;th&gt;Contribute&lt;/th&gt;
&lt;th&gt;Force push&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Contributors&lt;/td&gt;
&lt;td&gt;Deny&lt;/td&gt;
&lt;td&gt;Deny&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project Administrators&lt;/td&gt;
&lt;td&gt;Deny&lt;/td&gt;
&lt;td&gt;Deny&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project Build Service&lt;/td&gt;
&lt;td&gt;Allow&lt;/td&gt;
&lt;td&gt;Deny&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In Azure DevOps, &lt;strong&gt;Deny beats Allow&lt;/strong&gt;, and deleting a branch requires force-push. So no one, not even a project admin, can delete the branch or rewrite history, and only the pipeline can add commits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep scripts on a separate branch.&lt;/strong&gt; Once the backup branch is locked, you can't push script fixes to it either. An unprotected tooling branch solves that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Restoring, safe by default
&lt;/h2&gt;

&lt;p&gt;A second, manually triggered pipeline restores Logic Apps and connections from any backup version. The defaults are designed so a mis-click can't hurt production:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Logic Apps&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ALL&lt;/code&gt; (or a comma-separated list)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backup version&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;latest&lt;/code&gt; (or any commit ID)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Target&lt;/td&gt;
&lt;td&gt;Original subscription/resource group (or a new one)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State after restore&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Disabled&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create missing connections&lt;/td&gt;
&lt;td&gt;Yes (existing ones never overwritten)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dry run&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;On&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Under the hood it PUTs each workflow to the ARM REST API, rewrites resource IDs if the target differs, and creates the resource group if needed. At the end it prints a to-do list: connections to re-authorize, identities to re-grant, and trigger URLs that changed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: to check a restore you can't rehearse, wrap the same request bodies in an ARM template and run &lt;code&gt;az deployment group validate&lt;/code&gt;. Azure checks everything and deploys nothing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What a backup can't give you
&lt;/h2&gt;

&lt;p&gt;This protects your &lt;em&gt;definitions&lt;/em&gt;, not your whole environment:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gap&lt;/th&gt;
&lt;th&gt;What to do after restore&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Connection passwords / OAuth sign-ins&lt;/td&gt;
&lt;td&gt;Re-authorize connections (Office 365, Teams, SharePoint…)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP trigger URLs&lt;/td&gt;
&lt;td&gt;Re-created apps get new URLs, so update callers (overwriting in place keeps the URL)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed identity access&lt;/td&gt;
&lt;td&gt;Re-grant roles on Key Vault, Service Bus, etc.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Run history&lt;/td&gt;
&lt;td&gt;Not exportable. Accept the loss&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secrets in definitions&lt;/td&gt;
&lt;td&gt;Exported as-is. Keep the repo private or move secrets to Key Vault&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Rule of thumb: if the resource group and connections still exist, a restore takes minutes. If the whole subscription is gone, expect hours, mostly re-signing connections and updating callers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Count with the pipeline's identity, not yours.&lt;/strong&gt; My personal login saw a quarter of the Logic Apps; the service connection saw all of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't trust &lt;code&gt;az resource list&lt;/code&gt; counts.&lt;/strong&gt; Paged results can contain duplicates, so count unique resource IDs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit only on change.&lt;/strong&gt; Your history becomes a log of real portal edits, not daily noise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin third-party tools.&lt;/strong&gt; Pin the APIM extractor version so a new release can't change output overnight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grant the build identity Contribute.&lt;/strong&gt; Otherwise the first push fails with &lt;code&gt;TF401027&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;p&gt;One scheduled pipeline, one protected branch, and one restore pipeline give you daily, tamper-proof history of every Logic App, API connection, and APIM instance. Each morning's commit shows exactly what changed in production the day before, and any version can be put back.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>azure</category>
    </item>
    <item>
      <title>Azure DevOps knows what deployed. It has no idea what you released</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Tue, 22 Sep 2026 03:30:00 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/azure-devops-knows-what-deployed-it-has-no-idea-what-you-released-5h9m</link>
      <guid>https://dev.to/vicky_acedia/azure-devops-knows-what-deployed-it-has-no-idea-what-you-released-5h9m</guid>
      <description>&lt;p&gt;Our Configuration Manager asked me a question I could not answer.&lt;/p&gt;

&lt;p&gt;"For release 20260829.1, show me the list of changes, who approved each one, and confirm nothing else went out."&lt;/p&gt;

&lt;p&gt;I had everything and nothing. Seven applications, three pipelines each (front end, back end, database), a Saturday production window, complete build history going back years. Every deployment logged, every commit traceable, every pipeline run timestamped. And I could not answer the question.&lt;/p&gt;

&lt;p&gt;Here is why, and what I built to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape of the gap
&lt;/h2&gt;

&lt;p&gt;Azure DevOps is pipeline-centric. Its unit of truth is a run: this YAML, this commit, this agent, this artifact, this environment, at this time. That model is excellent for the question "what is running in production right now" and useless for the question "what was release 20260829.1."&lt;/p&gt;

&lt;p&gt;A release, in the sense an auditor means it, is a different kind of object:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a named, agreed scope of changes&lt;/li&gt;
&lt;li&gt;decided &lt;strong&gt;before&lt;/strong&gt; deployment&lt;/li&gt;
&lt;li&gt;approved by someone who did not write the code&lt;/li&gt;
&lt;li&gt;verified &lt;strong&gt;after&lt;/strong&gt; deployment to have shipped exactly that scope and nothing more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ADO has no such object. It has runs, and a run is evidence of deployment, not evidence of intent. You can reconstruct intent by hand: pull the run, get the commits, walk the commits back to pull requests, walk the PRs back to work items, then go read each work item's comment thread looking for something that resembles an approval. I did that once, for one release, for one application. It took most of a day and produced an answer I would not defend in an audit, because the reconstruction had no fixed point. If a change shipped and nobody had approved it, the reconstruction would happily tell me it shipped. It had no way to notice that nobody had said yes.&lt;/p&gt;

&lt;p&gt;That is the actual failure. Not missing data. Missing intent recorded ahead of time, against which the data can be checked.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: write down the intent first
&lt;/h2&gt;

&lt;p&gt;The whole system rests on one idea. Before a deployment, create a durable object that says "this release is these changes, approved by these people, on this date." After the deployment, go and find what actually shipped. Compare the two lists.&lt;/p&gt;

&lt;p&gt;That comparison is the product. Everything else is plumbing.&lt;/p&gt;

&lt;p&gt;The object itself is thin: a release tag, a target application, a window, a scope of work items, an approval record per item, a state. Three states turned out to be enough: Planned, Deploying, Closed. Planned means intent is recorded and approved. Deploying means the window has opened and discovery is running. Closed means reconciliation was reviewed and someone signed off in writing.&lt;/p&gt;

&lt;h2&gt;
  
  
  I built it backwards the first time
&lt;/h2&gt;

&lt;p&gt;My first version was pipeline-first. Pick the pipeline runs that made up the release, then walk back to find the stories. It demoed beautifully and was wrong.&lt;/p&gt;

&lt;p&gt;Pipeline-first can only describe what happened. You cannot plan a release out of pipeline runs, because at planning time the runs do not exist yet. Worse, it structurally cannot detect the case the auditor actually cares about, which is a change that shipped without approval. If your source of truth is the set of runs, everything in it is by definition part of the release.&lt;/p&gt;

&lt;p&gt;The second version is story-first. Planning starts from the backlog: select the work items you intend to ship, check each one against readiness criteria, classify the change, route it for approval. The approval is recorded against the work item, by a named person, with a timestamp, and the approver cannot be the person who wrote the change. That last rule is one line of validation and the single most valuable thing in the entire application.&lt;/p&gt;

&lt;p&gt;If you build something like this, start with the approval record. It is the fixed point everything else is measured against.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding what actually shipped
&lt;/h2&gt;

&lt;p&gt;Post-deployment discovery is the part I expected to be hard and turned out to be mechanical, once I stopped trying to use the obvious link.&lt;/p&gt;

&lt;p&gt;The obvious link is commits. Take the pipeline run, get its commit list, map commits to work items. This is fragile: squash merges collapse history, cherry-picks duplicate it, reverts pollute it, and the commit-to-work-item association depends on developers remembering to type &lt;code&gt;#71549&lt;/code&gt; in a message.&lt;/p&gt;

&lt;p&gt;Pull requests are far better. A completed PR in ADO has a stable, queryable relationship to its work items and appears in the build's associated changes. So discovery runs in the other direction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for each work item in the approved scope:
    find its completed pull requests
    for each PR, find the pipeline runs that included it
    tag those runs with the release tag

for each discovered run:
    list every PR it carried
    for each PR, resolve its work items
    any work item not in the approved scope is a passenger
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things fall out of this for free. Runs get tagged in ADO with the release tag, so the evidence lives where auditors already look rather than only inside my tool. And the passenger detection is automatic. I did not write a rule to find unapproved changes. It is just the set difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three buckets
&lt;/h2&gt;

&lt;p&gt;Reconciliation produces exactly three lists, and the entire compliance conversation happens inside them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delivered as planned.&lt;/strong&gt; Approved, shipped. The boring bucket. It should be nearly everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Planned but not delivered.&lt;/strong&gt; Approved and did not ship. Usually harmless, occasionally a live problem: a story that was approved, marked done, communicated to a client, and is not actually in production. Nobody notices this without an explicit check, because nothing failed. The pipeline went green.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delivered but never approved.&lt;/strong&gt; Shipped and nobody said yes. This is the bucket the whole system exists for. A change rides along on a shared branch, catches the release train, and reaches production without review. The pipeline is green, the deployment is clean, the audit trail is a hole. My tool raises a hard stop on this and will not let the release close until it is either explained or recorded as an exception.&lt;/p&gt;

&lt;p&gt;The first time I ran it against real history, it found one. That finding paid for the build.&lt;/p&gt;

&lt;p&gt;Closing a release requires a written sign-off. Free text, mandatory, stored. Not a checkbox, because a checkbox tells a future reader nothing. A sentence like "confirmed login, encryption and notifications on production at 09:40" tells them what was actually verified and by whom.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;p&gt;It does not gate deployments. The pipelines still run whether my console approves anything or not, deliberately, because a compliance tool that can block a Saturday production window is a compliance tool that gets bypassed in the first emergency. It observes and it reports, and the pressure it creates is social, not technical. That is a real trade-off and reasonable people would make it differently.&lt;/p&gt;

&lt;p&gt;It also does not eliminate the possibility of someone lying to it. Segregation of duties is enforced on the approval record, not on human behaviour. Two colleagues can still rubber-stamp each other. What the tool guarantees is that the rubber-stamping is legible afterwards, with names and timestamps attached. That is a lower bar than prevention and it is the bar most audit frameworks actually set.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell you if you have the same problem
&lt;/h2&gt;

&lt;p&gt;Your CI system's data model is not your governance model, and no amount of dashboards on top of pipeline runs will bridge that. The missing piece is almost always a record of intent, written before the event, owned by someone who is not the implementer.&lt;/p&gt;

&lt;p&gt;Once you have that record, the useful output is not a green tick. It is a diff.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>compliance</category>
    </item>
    <item>
      <title>PDF Rendering for HR at Scale: Why Your Simple Test Fails (and How to Fix It)</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Mon, 21 Sep 2026 03:42:35 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/pdf-rendering-for-hr-at-scale-why-your-simple-test-fails-and-how-to-fix-it-296n</link>
      <guid>https://dev.to/vicky_acedia/pdf-rendering-for-hr-at-scale-why-your-simple-test-fails-and-how-to-fix-it-296n</guid>
      <description>&lt;h1&gt;
  
  
  PDF Rendering for HR at Scale: Why Your Simple Test Fails (and How to Fix It)
&lt;/h1&gt;

&lt;p&gt;We spent two weeks evaluating PDF-generation vendors for our talent acquisition platform. Here's what we learned, why a naive test gives you garbage results, and the template anyone can use to pick the right engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Our platform generates offers, appointment letters, and onboarding docs for candidates across India, Mexico, and the US. These PDFs carry salary and personal data. We needed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fidelity.&lt;/strong&gt; Multi-page documents with headers, footers, page numbers, table headers that repeat across pages, and no orphaned headings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security.&lt;/strong&gt; Data stays encrypted; no vendor logging of content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; We're bootstrapped; $10k/yr on a renderer we could build ourselves is hard to justify.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We looked at &lt;strong&gt;Gotenberg&lt;/strong&gt; (self-hosted), &lt;strong&gt;PDFShift&lt;/strong&gt;, and &lt;strong&gt;DocRaptor&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How We Broke Our Own Test
&lt;/h2&gt;

&lt;p&gt;Day one, we grabbed a screenshot of our profile screen from our HR system (Angular + PrimeNG), pasted the raw HTML into DocRaptor's try-it-out page, and got back a PDF full of grey boxes where icons should be.&lt;/p&gt;

&lt;p&gt;Conclusion: "PDF generation looks crap; all engines probably suck."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We were completely wrong.&lt;/strong&gt; We'd tested nothing.&lt;/p&gt;

&lt;p&gt;The screenshot HTML had:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero inline CSS (all styles lived in component stylesheets on the page)&lt;/li&gt;
&lt;li&gt;Icon fonts and SVGs that never loaded (no external URLs allowed)&lt;/li&gt;
&lt;li&gt;Angular metadata (&lt;code&gt;_ngcontent-wij-c34&lt;/code&gt;) that meant nothing in a PDF&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;@page&lt;/code&gt; rules, no print CSS, no structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rendering a screen UI as a PDF is not the same as rendering a print template. Every engine — Prince, Chromium, even LibreOffice — gives the same result from garbage input: garbage output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; Your test isn't testing the engine. It's testing your understanding of what a PDF template is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Right Test
&lt;/h2&gt;

&lt;p&gt;A real PDF is &lt;strong&gt;self-contained HTML with embedded CSS&lt;/strong&gt;. No external stylesheets. No dynamic JavaScript. No assumptions about available fonts.&lt;/p&gt;

&lt;p&gt;We built a single &lt;code&gt;.html&lt;/code&gt; file that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Contains everything.&lt;/strong&gt; Inline &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; block with &lt;code&gt;@page&lt;/code&gt; rules, print CSS, margins, headers/footers, page numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Uses print-specific CSS.&lt;/strong&gt; &lt;code&gt;@page { size: A4; margin: 28mm 20mm; }&lt;/code&gt;, &lt;code&gt;@top-center { content: element(pageHeader); }&lt;/code&gt;, &lt;code&gt;counter(page)&lt;/code&gt;, &lt;code&gt;page-break-inside: avoid&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests the hard cases:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Multi-page table with &lt;code&gt;&amp;lt;thead&amp;gt;&lt;/code&gt; that repeats&lt;/li&gt;
&lt;li&gt;Rows that must never split across pages&lt;/li&gt;
&lt;li&gt;Running headers and footers&lt;/li&gt;
&lt;li&gt;Glyph rendering: ₹ (rupee), € (euro), ñ (Spanish n), and em-dashes&lt;/li&gt;
&lt;li&gt;Long numbered lists that span pages&lt;/li&gt;
&lt;li&gt;Signature blocks that shouldn't split&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Uses dummy data, not real PII.&lt;/strong&gt; Template goes into version control; you can iterate on it without legal questions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's the structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;@page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;A4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;28mm&lt;/span&gt; &lt;span class="m"&gt;20mm&lt;/span&gt; &lt;span class="m"&gt;24mm&lt;/span&gt; &lt;span class="m"&gt;20mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="err"&gt;@top-center&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageHeader&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;@bottom-center&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageFooter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="err"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;.page-header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;running&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageHeader&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;.page-footer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;running&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageFooter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;border-collapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;collapse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="nt"&gt;thead&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;table-header-group&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="c"&gt;/* repeats on every page */&lt;/span&gt;
    &lt;span class="nt"&gt;tr&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;page-break-inside&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;avoid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="c"&gt;/* no row splits */&lt;/span&gt;
    &lt;span class="nt"&gt;h2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;page-break-after&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;avoid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="c"&gt;/* no orphaned headings */&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page-header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Header text&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page-footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Page &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page-number"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- Your content here --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;@page&lt;/code&gt; and &lt;code&gt;page-break-*&lt;/code&gt; rules are where the magic happens. Most developers skip them because screen CSS doesn't need them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Tested
&lt;/h2&gt;

&lt;p&gt;We sent the same template to three engines:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;Entry cost&lt;/th&gt;
&lt;th&gt;Ops burden&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DocRaptor&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cloud API, Prince engine&lt;/td&gt;
&lt;td&gt;$15–75/mo&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PDFShift&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cloud API, Chromium&lt;/td&gt;
&lt;td&gt;$9/mo&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gotenberg&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Self-hosted Docker, Chromium + LibreOffice&lt;/td&gt;
&lt;td&gt;$0 license&lt;/td&gt;
&lt;td&gt;Small&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The scorecard:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test case&lt;/th&gt;
&lt;th&gt;DocRaptor (Prince)&lt;/th&gt;
&lt;th&gt;PDFShift (Chromium)&lt;/th&gt;
&lt;th&gt;Gotenberg (Chromium)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Headers / footers&lt;/td&gt;
&lt;td&gt;✓ Native CSS&lt;/td&gt;
&lt;td&gt;✗ API workaround needed&lt;/td&gt;
&lt;td&gt;✗ API workaround needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Page X of Y"&lt;/td&gt;
&lt;td&gt;✓ &lt;code&gt;counter(pages)&lt;/code&gt; works&lt;/td&gt;
&lt;td&gt;✗ Harder&lt;/td&gt;
&lt;td&gt;✗ Harder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Running table headers&lt;/td&gt;
&lt;td&gt;✓ Perfect&lt;/td&gt;
&lt;td&gt;✓ Works&lt;/td&gt;
&lt;td&gt;✓ Works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row split prevention&lt;/td&gt;
&lt;td&gt;✓ Reliable&lt;/td&gt;
&lt;td&gt;✓ Works&lt;/td&gt;
&lt;td&gt;✓ Works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Glyph rendering&lt;/td&gt;
&lt;td&gt;✓ All render&lt;/td&gt;
&lt;td&gt;✓ All render&lt;/td&gt;
&lt;td&gt;✓ All render&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-line orphan control&lt;/td&gt;
&lt;td&gt;✓ Strong&lt;/td&gt;
&lt;td&gt;~ Moderate&lt;/td&gt;
&lt;td&gt;~ Moderate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File size&lt;/td&gt;
&lt;td&gt;250 KB&lt;/td&gt;
&lt;td&gt;280 KB&lt;/td&gt;
&lt;td&gt;270 KB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concurrency (50 parallel)&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;p95 = 2.3s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Prince wins on CSS elegance (headers/footers as CSS, not API calls). Chromium ties on everything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Decision
&lt;/h2&gt;

&lt;p&gt;If you have $75/mo budget and zero ops overhead matters, &lt;strong&gt;Prince (DocRaptor) wins slightly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you have $0 tolerance for vendors, &lt;strong&gt;Gotenberg (free, self-hosted) is completely adequate&lt;/strong&gt;. The header/footer API calls are a one-time 20-line setup.&lt;/p&gt;

&lt;p&gt;If you're on a tight budget and already have a Kubernetes cluster, &lt;strong&gt;Gotenberg&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you want zero infrastructure and the budget is fine, &lt;strong&gt;DocRaptor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We picked DocRaptor because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cost is fine at scale.&lt;/strong&gt; 200–300 offers/month = $29/mo tier. Not a blocker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero ops.&lt;/strong&gt; We don't want another container to upgrade and patch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security is better than DIY.&lt;/strong&gt; Their SOC 2 audit, encryption in transit and at rest, 24-hour breach notification — better than we'd build ourselves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But we kept Gotenberg as a fallback. If DocRaptor ever blocked us or raised prices, swapping takes one day because we wrote the templates in standard CSS, no Prince extensions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Security Bits (Don't Forget These)
&lt;/h2&gt;

&lt;p&gt;PDF generation touches salary data. Before you pick a vendor:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Where does it run?&lt;/strong&gt; (DocRaptor: AWS us-east-1. That's fine for India if you have a contract and disclose it in your privacy notice.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is content logged?&lt;/strong&gt; (DocRaptor: no. Metadata only.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How long is it stored?&lt;/strong&gt; (DocRaptor: configurable, encrypted in S3, auto-deleted.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What's their security posture?&lt;/strong&gt; (DocRaptor: SOC 2 Type II, ISO 27001 path.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-processors?&lt;/strong&gt; (DocRaptor: AWS, Stripe, a few analytics tools. All listed.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ask these in an email before you commit. Don't assume.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Did Wrong (So You Don't)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Tested the wrong input.&lt;/strong&gt; Screen HTML ≠ print template. We wasted a day learning that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Didn't specify print CSS.&lt;/strong&gt; &lt;code&gt;@page&lt;/code&gt; and &lt;code&gt;page-break-*&lt;/code&gt; aren't optional. They're the entire difference between "works" and "works perfectly."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assumed all engines were equivalent.&lt;/strong&gt; They're not. Prince is better at paged media; Chromium is fine and cheaper.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Didn't think about fallback.&lt;/strong&gt; We picked the vendor, then realized we had no plan B. Now we keep the Gotenberg container ready.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Didn't test glyph rendering across locales.&lt;/strong&gt; We added that halfway through. It matters if you support multiple countries.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Template
&lt;/h2&gt;

&lt;p&gt;Here's the full test template we built. Use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;PDF Fidelity Test&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;@page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;A4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;28mm&lt;/span&gt; &lt;span class="m"&gt;20mm&lt;/span&gt; &lt;span class="m"&gt;24mm&lt;/span&gt; &lt;span class="m"&gt;20mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="err"&gt;@top-center&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageHeader&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;@bottom-center&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageFooter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="err"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;.page-header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;running&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageHeader&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;9pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#555&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#999&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;padding-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;.page-footer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;running&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageFooter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8.5pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#555&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;border-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#999&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"Noto Sans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;"DejaVu Sans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10.5pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.45&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#111&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;6mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;h2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;12.5pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8mm&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;page-break-after&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;avoid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3.5mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;border-collapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;collapse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3mm&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;5mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="nt"&gt;th&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="nt"&gt;td&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#bbb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;vertical-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;top&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="nt"&gt;th&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#eee&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="nt"&gt;thead&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;table-header-group&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="nt"&gt;tr&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;page-break-inside&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;avoid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nc"&gt;.glyph-test&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;12pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;.annexure&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;page-break-before&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page-header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;TEST TEMPLATE — Document&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page-footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Page &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"pageNumber"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt; of &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"totalPages"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Document Title&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a test template for PDF rendering evaluation.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Section 1: Basic content&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Section 2: Glyph rendering&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;table&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"glyph-test"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;Rupee (₹)&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;₹ 1,25,000&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;Spanish (ñ, á, ¿)&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;Señor, Ramírez, ¿Cuándo?&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;Euro (€)&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;€ 1.234,56&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;Typography&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;"Curly quotes" — em dash … ellipsis&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Section 3: Long table (tests header repeat and row integrity)&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;#&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;Item&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;Description&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row one&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;2&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row two&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;3&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row three&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;4&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row four&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;5&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row five&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;6&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row six&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;7&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row seven&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;8&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row eight&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;9&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row nine&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;10&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Row ten&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;This row should not split.&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"annexure"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Annexure A&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This content starts on a new page.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Tables on this page should also have repeating headers.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;#&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;Item&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Page 2 row 1&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;2&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Page 2 row 2&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this, paste it into your vendor's try-it-out page or API, and score against the test cases above.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We'd Do Differently
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run the test first.&lt;/strong&gt; Don't assume all engines are the same.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick the simplest thing that works.&lt;/strong&gt; If Chromium is 95% as good as Prince and costs 10x less, that's a win.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build in fallback from day one.&lt;/strong&gt; Lock your templates to standard CSS. That's your insurance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask security questions early.&lt;/strong&gt; Not because vendors hide things, but because your legal team needs to know the answers before you go live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document the decision.&lt;/strong&gt; Six months from now you won't remember why you picked this. Write it down.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Takeaway
&lt;/h2&gt;

&lt;p&gt;PDF rendering sounds simple until it's not. The engine matters less than the input. A good template — one that declares &lt;code&gt;@page&lt;/code&gt;, uses &lt;code&gt;page-break-*&lt;/code&gt;, and embeds fonts — works on any modern engine. A bad template fails everywhere.&lt;/p&gt;

&lt;p&gt;Test early, test with the right input, keep templates portable, and ask about security before you commit.&lt;/p&gt;

&lt;p&gt;That's it. Go render PDFs.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;We're using DocRaptor (for now). We haven't ruled out Gotenberg. If you've done this evaluation for your own platform, I'd love to hear what you picked and why.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>systems</category>
    </item>
    <item>
      <title>Exposing a Microsoft Foundry Agent over A2A Through Azure API Management — The Click-by-Click Guide</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Sun, 06 Sep 2026 04:33:54 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/exposing-a-microsoft-foundry-agent-over-a2a-through-azure-api-management-the-click-by-click-guide-56ij</link>
      <guid>https://dev.to/vicky_acedia/exposing-a-microsoft-foundry-agent-over-a2a-through-azure-api-management-the-click-by-click-guide-56ij</guid>
      <description>&lt;p&gt;&lt;em&gt;Last verified: September 2026. Foundry's incoming-A2A endpoint is still in public preview; APIM's A2A agent API support is GA.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What you will have at the end
&lt;/h2&gt;

&lt;p&gt;A Foundry agent that any authorised client on your network can call &lt;strong&gt;through your API gateway&lt;/strong&gt;, using the open Agent2Agent (A2A) protocol, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Postman / your app / another agent
        │
        │  POST  https://api.yourcompany.com/agents/helper-agent
        │  Header: Ocp-Apim-Subscription-Key
        ▼
Azure Front Door (optional, if your APIM is private)
        ▼
Azure API Management  ──►  gets its own Entra token  ──►  Microsoft Foundry
   (rate limits, keys,      (managed identity)             (your agent runs,
    logging, policies)                                       answers, done)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll finish when you send a JSON-RPC message from Postman and get the agent's answer back. Nothing more. Wiring a &lt;em&gt;second&lt;/em&gt; agent to call the first, or turning agents into MCP tools, are follow-on articles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why bother with the gateway at all?
&lt;/h3&gt;

&lt;p&gt;Foundry agents already have an endpoint. Two reasons to put APIM in front:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Governance.&lt;/strong&gt; Subscription keys, per-consumer quotas, content-safety policies, App Insights traces — all in one place you already operate. When Security asks "who can call this agent and how often?", the answer is an APIM product, not a wiki page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One front door for everything.&lt;/strong&gt; The same URL pattern works for Foundry agents today and for agents hosted anywhere else (Container Apps, other clouds) tomorrow.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Before you start — read this once
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Things you need&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Thing&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A Foundry project (New Foundry experience toggled on)&lt;/td&gt;
&lt;td&gt;Where the agent lives&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Owner&lt;/strong&gt; or &lt;strong&gt;Foundry Project Manager&lt;/strong&gt; on that project&lt;/td&gt;
&lt;td&gt;To create agents and assign roles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An APIM instance with &lt;strong&gt;System-assigned managed identity turned on&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;APIM must prove &lt;em&gt;who it is&lt;/em&gt; to Foundry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Contributor&lt;/strong&gt; on the APIM instance&lt;/td&gt;
&lt;td&gt;To add APIs and edit policies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Postman (or curl)&lt;/td&gt;
&lt;td&gt;To test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;~45 minutes&lt;/td&gt;
&lt;td&gt;Role assignments take a few minutes to propagate; budget for waiting&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Placeholders used in this article — replace every one of them&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Placeholder&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Where to find yours&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;contoso-agents-poc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Foundry &lt;strong&gt;account&lt;/strong&gt; name (the parent resource)&lt;/td&gt;
&lt;td&gt;Foundry portal → Manage → Project details → &lt;em&gt;Parent resource&lt;/em&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;contoso-agents-poc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Foundry &lt;strong&gt;project&lt;/strong&gt; name&lt;/td&gt;
&lt;td&gt;Same page → &lt;em&gt;Name&lt;/em&gt;. Often identical to the account name for the default project.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;helper-agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The agent you're exposing&lt;/td&gt;
&lt;td&gt;Whatever you named it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;contoso-apim&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your APIM instance name&lt;/td&gt;
&lt;td&gt;Azure portal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;https://api.yourcompany.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The public URL clients use to reach APIM&lt;/td&gt;
&lt;td&gt;Either &lt;code&gt;https://contoso-apim.azure-api.net&lt;/code&gt; or your custom domain / Front Door hostname&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The one URL that matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every Foundry agent has a stable endpoint. Its A2A path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;https://{account}.services.ai.azure.com/api/projects/{project}/agents/{agent}/endpoint/protocols/a2a
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filled in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;https://contoso-agents-poc.services.ai.azure.com/api/projects/contoso-agents-poc/agents/helper-agent/endpoint/protocols/a2a
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy that into a notepad. You'll paste it four times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two things that will confuse you if nobody warns you&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Foundry's A2A endpoint &lt;strong&gt;requires Entra authentication for everything&lt;/strong&gt;, including reading the agent card. Anything that tries to fetch it anonymously fails. APIM's import wizard does exactly that, so it &lt;em&gt;will&lt;/em&gt; fail, and that's expected. We handle it.&lt;/li&gt;
&lt;li&gt;Foundry serves A2A protocol &lt;strong&gt;v0.3 by default&lt;/strong&gt; unless you ask for v1.0 with a header. We'll set that header in APIM so clients don't have to think about it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Part A — Set up the agent in Foundry
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A1. Create the agent (skip if you already have one)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://ai.azure.com" rel="noopener noreferrer"&gt;ai.azure.com&lt;/a&gt;. Make sure the &lt;strong&gt;New Foundry&lt;/strong&gt; toggle (top right) is &lt;strong&gt;on&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Open your project → &lt;strong&gt;Build&lt;/strong&gt; → &lt;strong&gt;Agents&lt;/strong&gt; → &lt;strong&gt;+ Create agent&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Name it &lt;code&gt;helper-agent&lt;/code&gt;. Pick a model (any deployed chat model — &lt;code&gt;gpt-4o-mini&lt;/code&gt; is fine).&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Instructions&lt;/strong&gt;, write something real. A blank agent answers like a generic chatbot, which makes later testing meaningless. Example:&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;You answer questions about company holiday policy. Be brief. If asked anything else, say it's outside your scope.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt; (top right). This creates version 1. The agent's endpoint is live from this moment — there is no separate "publish" step.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  A2. Create the agent card and enable A2A
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;agent card&lt;/em&gt; is a small JSON document that tells other agents what this one can do. Creating it in the portal also turns on the A2A protocol for the agent.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;helper-agent&lt;/code&gt; → &lt;strong&gt;Details&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Find the &lt;strong&gt;A2A&lt;/strong&gt; / &lt;strong&gt;Agent card&lt;/strong&gt; section and click &lt;strong&gt;Create an agent card&lt;/strong&gt; (it's marked &lt;em&gt;Preview&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;Fill it in. Write it for a machine that has to decide whether to call you, not for a human:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;| Field | What to put | Example |&lt;br&gt;
   |---|---|---|&lt;br&gt;
   | Name | Pre-filled | &lt;code&gt;helper-agent&lt;/code&gt; |&lt;br&gt;
   | Description | 1–2 sentences: what it answers, what it doesn't | &lt;em&gt;Answers questions about company holiday and leave policy. Does not handle payroll or IT.&lt;/em&gt; |&lt;br&gt;
   | Skill name | Short noun phrase | &lt;code&gt;Holiday policy queries&lt;/code&gt; |&lt;br&gt;
   | Tags | Comma-separated keywords | &lt;code&gt;holiday, leave, policy, hr&lt;/code&gt; |&lt;br&gt;
   | Skill description | What a request looks like, what comes back | &lt;em&gt;Given a question about leave or holidays, returns the relevant policy answer.&lt;/em&gt; |&lt;br&gt;
   | Example prompts | 3–4 real ones, one per line | &lt;em&gt;How many days of annual leave do I get?&lt;/em&gt; |&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Save.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's the Foundry side done. Your agent now accepts A2A requests at the URL you copied earlier — from anyone holding a valid Entra token with the right role. Next we make APIM that someone.&lt;/p&gt;


&lt;h2&gt;
  
  
  Part B — Register the agent in API Management
&lt;/h2&gt;
&lt;h3&gt;
  
  
  B1. Open the A2A wizard
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Azure portal → your APIM instance (&lt;code&gt;contoso-apim&lt;/code&gt;) → left menu &lt;strong&gt;APIs&lt;/strong&gt; → &lt;strong&gt;+ Add API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Find the tile &lt;strong&gt;A2A Agent&lt;/strong&gt;. Click it.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Don't see the tile?&lt;/strong&gt; A2A support arrived for v2 tiers first and was extended to classic tiers in the June 2026 release. Check your tier and that the instance is updated. If it's genuinely absent, stop here — the rest of this article won't apply.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  B2. Paste the agent card URL (and watch it fail on purpose)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In &lt;strong&gt;URL&lt;/strong&gt;, paste the card URL — that's your A2A base URL with &lt;code&gt;/agentCard/v1.0&lt;/code&gt; on the end:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;   https://contoso-agents-poc.services.ai.azure.com/api/projects/contoso-agents-poc/agents/helper-agent/endpoint/protocols/a2a/agentCard/v1.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You'll see a red banner: &lt;em&gt;"We couldn't retrieve the agent card, possibly due to a wrong url or your network configuration. Enter the agent API details manually below."&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;This is expected.&lt;/strong&gt; APIM fetched the card anonymously; Foundry said no. The URL is not wrong. Carry on.&lt;/p&gt;
&lt;h3&gt;
  
  
  B3. Fill the form manually
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Protocol&lt;/td&gt;
&lt;td&gt;JSON-RPC (pre-selected, greyed out — APIM only supports this one)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Runtime URL (JSON-RPC)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your A2A base URL — the one &lt;strong&gt;without&lt;/strong&gt; &lt;code&gt;/agentCard/v1.0&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent ID&lt;/td&gt;
&lt;td&gt;&lt;code&gt;helper-agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Display name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Helper Agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;helper-agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Description&lt;/td&gt;
&lt;td&gt;Anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Products&lt;/td&gt;
&lt;td&gt;Leave empty for now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Base path&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;agents/helper-agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As you type the base path, the two read-only URLs underneath update to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Base URL (JSON-RPC): &lt;code&gt;https://contoso-apim.azure-api.net/agents/helper-agent&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Agent card URL: &lt;code&gt;https://contoso-apim.azure-api.net/agents/helper-agent/agent-card.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  B4. Don't panic about the blank field
&lt;/h3&gt;

&lt;p&gt;The Overview page shows &lt;em&gt;Backend runtime base URL&lt;/em&gt; as empty, even though you just filled Runtime URL. Sometimes the Settings page also shows it empty on reload. This is a portal quirk. We will set the backend explicitly in the policy in Part D, which makes this field irrelevant. Move on.&lt;/p&gt;


&lt;h2&gt;
  
  
  Part C — Let APIM authenticate to Foundry
&lt;/h2&gt;

&lt;p&gt;Foundry only accepts requests carrying an Entra token from an identity that has a Foundry role on the project. APIM will present its own &lt;strong&gt;managed identity&lt;/strong&gt;. Two steps: confirm APIM has one, then grant it a role.&lt;/p&gt;
&lt;h3&gt;
  
  
  C1. Confirm APIM's managed identity is on
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Azure portal → the APIM &lt;strong&gt;service&lt;/strong&gt; (not the API you just made) → left menu &lt;strong&gt;Security&lt;/strong&gt; → &lt;strong&gt;Managed identities&lt;/strong&gt; → &lt;strong&gt;System assigned&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Status should be &lt;strong&gt;On&lt;/strong&gt;. Note the &lt;strong&gt;Object (principal) ID&lt;/strong&gt; — you'll recognise it in the next step.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If it's &lt;strong&gt;Off&lt;/strong&gt;: switching it on is harmless technically, but on a shared or production instance tell whoever owns it first. Then toggle &lt;strong&gt;On&lt;/strong&gt; → &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  C2. Grant the managed identity a role on the Foundry project
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Azure portal → search for your Foundry &lt;strong&gt;project&lt;/strong&gt; resource (type: &lt;em&gt;Foundry project&lt;/em&gt;, not &lt;em&gt;Foundry account&lt;/em&gt;) → open it.&lt;/li&gt;
&lt;li&gt;Left menu &lt;strong&gt;Access control (IAM)&lt;/strong&gt; → &lt;strong&gt;+ Add&lt;/strong&gt; → &lt;strong&gt;Add role assignment&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role&lt;/strong&gt; tab: search &lt;code&gt;Foundry User&lt;/code&gt;. Select it. &lt;strong&gt;Next&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Why Foundry User and not Foundry Agent Consumer?&lt;/em&gt; Agent Consumer is the least-privilege role designed for exactly this, but at the time of writing it doesn't appear in the portal's role picker. Foundry User is documented as "or higher" and works. If you need least-privilege, assign Agent Consumer via CLI with role definition ID &lt;code&gt;eed3b665-ab3a-47b6-8f48-c9382fb1dad6&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Members&lt;/strong&gt; tab: select &lt;strong&gt;Managed identity&lt;/strong&gt; → &lt;strong&gt;+ Select members&lt;/strong&gt;.

&lt;ul&gt;
&lt;li&gt;Subscription: the one your APIM lives in&lt;/li&gt;
&lt;li&gt;Managed identity dropdown: &lt;strong&gt;API Management service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Pick &lt;code&gt;contoso-apim&lt;/code&gt; → &lt;strong&gt;Select&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review + assign&lt;/strong&gt; → &lt;strong&gt;Review + assign&lt;/strong&gt; again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Back on the IAM page, expand &lt;strong&gt;Foundry User&lt;/strong&gt; and confirm &lt;code&gt;contoso-apim&lt;/code&gt; is listed with type &lt;em&gt;Managed identity&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now wait 3–5 minutes.&lt;/strong&gt; Role assignments propagate asynchronously. If you test immediately you'll get 401/403 and think something's broken.&lt;/p&gt;


&lt;h2&gt;
  
  
  Part D — The policy
&lt;/h2&gt;

&lt;p&gt;This is where APIM is told: &lt;em&gt;get a token as yourself, forward everything to the agent's A2A endpoint, and ask for protocol v1.0.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;APIM → &lt;strong&gt;APIs&lt;/strong&gt; → &lt;code&gt;helper-agent&lt;/code&gt; → left menu &lt;strong&gt;Policies&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You'll see an XML editor with &lt;code&gt;&amp;lt;policies&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;inbound&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;backend&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;outbound&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;on-error&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Select all, delete, paste this&lt;/strong&gt;, replacing the URL with yours:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;policies&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;inbound&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;base&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;authentication-managed-identity&lt;/span&gt; &lt;span class="na"&gt;resource=&lt;/span&gt;&lt;span class="s"&gt;"https://ai.azure.com"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;set-backend-service&lt;/span&gt; &lt;span class="na"&gt;base-url=&lt;/span&gt;&lt;span class="s"&gt;"https://contoso-agents-poc.services.ai.azure.com/api/projects/contoso-agents-poc/agents/helper-agent/endpoint/protocols/a2a"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;set-header&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"A2A-Version"&lt;/span&gt; &lt;span class="na"&gt;exists-action=&lt;/span&gt;&lt;span class="s"&gt;"override"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;value&amp;gt;&lt;/span&gt;1.0&lt;span class="nt"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/set-header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/inbound&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;backend&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;base&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/backend&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;outbound&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;base&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/outbound&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;on-error&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;base&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/on-error&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/policies&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Save.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Line by line, in plain words:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;authentication-managed-identity resource="https://ai.azure.com"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;APIM gets an Entra token for itself, scoped to Foundry, and puts it in the &lt;code&gt;Authorization&lt;/code&gt; header. This is the whole reason Part C existed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;set-backend-service base-url=…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Forward the request to the agent's A2A endpoint. Overrides whatever the Settings page did or didn't save.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;set-header A2A-Version 1.0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ask Foundry for protocol v1.0. Without this you silently get v0.3, which has a different message shape.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  Part E — Get a subscription key
&lt;/h2&gt;

&lt;p&gt;By default an APIM API requires a subscription key. Grab one:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;APIM → left menu &lt;strong&gt;Subscriptions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Find the row &lt;strong&gt;Built-in all-access subscription&lt;/strong&gt; (or create one scoped to this API).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;…&lt;/strong&gt; on the right → &lt;strong&gt;Show/hide keys&lt;/strong&gt; → copy &lt;strong&gt;Primary key&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep it in your notepad next to the URL.&lt;/p&gt;


&lt;h2&gt;
  
  
  Part F — Test it
&lt;/h2&gt;
&lt;h3&gt;
  
  
  F1. Which URL to call
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;If your APIM is publicly reachable: &lt;code&gt;https://contoso-apim.azure-api.net&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If public access is disabled and you go through Front Door or a custom domain: that hostname instead, e.g. &lt;code&gt;https://api.yourcompany.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The path is the same either way: &lt;code&gt;/agents/helper-agent&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  F2. Set up the request in Postman
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;New request.&lt;/strong&gt; Method dropdown (left of the URL bar): &lt;strong&gt;POST&lt;/strong&gt;. Yes, POST. GET will return 404 from APIM and you'll waste ten minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;   https://api.yourcompany.com/agents/helper-agent
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Headers&lt;/strong&gt; tab — two rows:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;| Key | Value |&lt;br&gt;
   |---|---|&lt;br&gt;
   | &lt;code&gt;Ocp-Apim-Subscription-Key&lt;/code&gt; | the key from Part E |&lt;br&gt;
   | &lt;code&gt;Content-Type&lt;/code&gt; | &lt;code&gt;application/json&lt;/code&gt; |&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Body&lt;/strong&gt; tab → &lt;strong&gt;raw&lt;/strong&gt; → set the dropdown on the right to &lt;strong&gt;JSON&lt;/strong&gt; → paste:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"jsonrpc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SendMessage"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"messageId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"m1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ROLE_USER"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello, what can you do?"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Send.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  F3. What success looks like
&lt;/h3&gt;

&lt;p&gt;Status &lt;strong&gt;200&lt;/strong&gt; and a body like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"jsonrpc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"task"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"resp_…"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"contextId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ctxt_…"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TASK_STATE_COMPLETED"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-09-06T04:18:09+00:00"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"artifacts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"artifactId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"msg_…"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"I answer questions about company holiday policy. …"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent's reply is at &lt;code&gt;result.task.artifacts[0].parts[0].text&lt;/code&gt;. That path is what any consumer parses. &lt;code&gt;contextId&lt;/code&gt; is the conversation — send it back in later messages to keep context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You're done.&lt;/strong&gt; Front Door → APIM → managed identity → Foundry → agent → back. Every hop authenticated, every call logged in APIM.&lt;/p&gt;




&lt;h2&gt;
  
  
  Troubleshooting — read the status code, it's telling you exactly where it broke
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You see&lt;/th&gt;
&lt;th&gt;It means&lt;/th&gt;
&lt;th&gt;Do this&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;404&lt;/strong&gt; &lt;code&gt;{"statusCode":404,"message":"Resource not found"}&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;APIM itself replied. Usually wrong HTTP method (GET instead of POST) or wrong path.&lt;/td&gt;
&lt;td&gt;Check the method dropdown. Check the base path matches Part B3.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;401&lt;/strong&gt; &lt;em&gt;"Access denied due to missing subscription key"&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;APIM replied. No key or wrong header name.&lt;/td&gt;
&lt;td&gt;Header must be exactly &lt;code&gt;Ocp-Apim-Subscription-Key&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;401 / 403&lt;/strong&gt; with headers like &lt;code&gt;azureml-served-by-cluster&lt;/code&gt; or a body mentioning authorization&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Foundry&lt;/strong&gt; replied — APIM got through, but Foundry rejected APIM's identity.&lt;/td&gt;
&lt;td&gt;Role hasn't propagated (wait 5 min) or Part C2 was assigned on the wrong resource (must be the &lt;em&gt;project&lt;/em&gt;). Confirm &lt;code&gt;authentication-managed-identity&lt;/code&gt; is in the policy.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;405&lt;/strong&gt; with &lt;code&gt;allow: POST&lt;/code&gt; and &lt;code&gt;azureml-served-by-cluster&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Foundry&lt;/strong&gt; replied. You sent a GET to the base path.&lt;/td&gt;
&lt;td&gt;This is actually good news: it proves the whole auth chain works. Switch to POST.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;200&lt;/strong&gt; but body has &lt;code&gt;"code": -32601&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Foundry replied: method not found. You're hitting v0.3 but sent a v1.0 body (or vice versa).&lt;/td&gt;
&lt;td&gt;Confirm the &lt;code&gt;A2A-Version&lt;/code&gt; header line is in the policy and saved.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;200&lt;/strong&gt; and the agent answers like a generic chatbot&lt;/td&gt;
&lt;td&gt;Everything works; your agent has no instructions.&lt;/td&gt;
&lt;td&gt;Part A1 step 4.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Front Door error page instead of any of the above&lt;/td&gt;
&lt;td&gt;Front Door has no route for &lt;code&gt;/agents/*&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Add a route rule or use the APIM hostname directly if reachable.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Known gap: the agent card through APIM
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;GET https://api.yourcompany.com/agents/helper-agent/agent-card.json&lt;/code&gt; returns &lt;strong&gt;405&lt;/strong&gt; rather than the card.&lt;/p&gt;

&lt;p&gt;Because the import wizard couldn't fetch the card (Part B2), APIM never stored one, and it simply proxies the request to the agent's base path — which only accepts POST. Rewriting the path inside the policy (&lt;code&gt;rewrite-uri&lt;/code&gt;) didn't take effect on this API type in testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does it matter?&lt;/strong&gt; Not for calling the agent — you just proved that. It matters for &lt;em&gt;discovery&lt;/em&gt;: a client that wants to read the card first (for example, another Foundry agent using "Connect via endpoint") will fail at that step. Two workarounds we haven't fully validated yet: serve the card from the policy using &lt;code&gt;send-request&lt;/code&gt; + &lt;code&gt;return-response&lt;/code&gt;, or fetch the card once with a user token and host it as a static file. Both are on the follow-up list.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Let another Foundry agent call this one.&lt;/strong&gt; In the calling agent → Tools → Add → A2A → &lt;em&gt;Connect via endpoint&lt;/em&gt;, URL = your APIM URL, auth = custom key &lt;code&gt;Ocp-Apim-Subscription-Key&lt;/code&gt;. Needs the card gap above closed first — or use &lt;em&gt;Connect from Foundry&lt;/em&gt; to bypass APIM for Foundry-to-Foundry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expose several agents.&lt;/strong&gt; One A2A API per agent, same policy with the name swapped. After two, script it (Bicep / apiops).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn agents into MCP tools.&lt;/strong&gt; A2A APIs can't be exposed as MCP servers directly. Create one plain HTTP API in APIM with one POST operation per agent pointing at each agent's Responses endpoint (&lt;code&gt;…/endpoint/protocols/openai/responses&lt;/code&gt;), then &lt;em&gt;Expose existing API as MCP server&lt;/em&gt;. One MCP server, one tool per agent, fully GA end-to-end.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Cheat sheet
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A2A base URL     https://{account}.services.ai.azure.com/api/projects/{project}/agents/{agent}/endpoint/protocols/a2a
Card URL (v1.0)  …/protocols/a2a/agentCard/v1.0
Token scope      https://ai.azure.com/.default
Role             Foundry User (or Foundry Agent Consumer, ID eed3b665-ab3a-47b6-8f48-c9382fb1dad6)
Version header   A2A-Version: 1.0
JSON-RPC method  SendMessage   (v1.0)   |   message/send   (v0.3)
Reply path       result.task.artifacts[0].parts[0].text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ai</category>
      <category>azure</category>
    </item>
    <item>
      <title>Putting Azure OpenAI Behind an API Gateway: What the Docs Don't Tell You</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Thu, 03 Sep 2026 08:35:16 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/putting-azure-openai-behind-an-api-gateway-what-the-docs-dont-tell-you-10go</link>
      <guid>https://dev.to/vicky_acedia/putting-azure-openai-behind-an-api-gateway-what-the-docs-dont-tell-you-10go</guid>
      <description>&lt;p&gt;We had a problem that will sound familiar to anyone who has let a team loose on Azure OpenAI.&lt;/p&gt;

&lt;p&gt;One Foundry resource. One &lt;code&gt;gpt-4o-mini&lt;/code&gt; deployment. One API key, copied into a config file, then into a second config file, then pasted into a Slack thread so someone could test something quickly. No idea who was spending what. No limits. If one app got stuck in a retry loop at 2am, everybody's model calls would start failing and we'd spend the morning working out whose fault it was.&lt;/p&gt;

&lt;p&gt;The fix is an AI gateway. Azure API Management has a purpose-built wizard for this now, and the happy path genuinely is a wizard. But we hit roughly a dozen things that the documentation either glosses over or gets subtly wrong, and several of them are the kind of mistake you can't undo.&lt;/p&gt;

&lt;p&gt;This is what actually happened, in order, including the parts where I was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an AI gateway buys you
&lt;/h2&gt;

&lt;p&gt;Before the mechanics, the argument, because it's easy to build this and then not enforce it.&lt;/p&gt;

&lt;p&gt;Putting API Management in front of a model deployment gets you four things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One key per application, revocable independently.&lt;/strong&gt; Each consuming app gets its own gateway key. Revoke one, the others keep working. No app ever holds a credential for the model itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spend caps that are actually enforced.&lt;/strong&gt; A tokens-per-minute limit per application means one runaway loop can't drain the shared quota.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attribution.&lt;/strong&gt; Token counts land in Application Insights, dimensioned by which app made the call. "Who spent this" becomes a query instead of an investigation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caching.&lt;/strong&gt; Semantically similar questions can be answered from a cache rather than paid for twice.&lt;/p&gt;

&lt;p&gt;Keep that list in mind, because there's a trap at the end of this post where you build all of it and enforce none of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step one: pick the right client compatibility mode
&lt;/h2&gt;

&lt;p&gt;The wizard's first real decision is also its most expensive to get wrong, and it's presented as three innocuous radio buttons.&lt;/p&gt;

&lt;p&gt;You are asked to choose between &lt;strong&gt;Azure OpenAI&lt;/strong&gt;, &lt;strong&gt;Azure AI&lt;/strong&gt;, and &lt;strong&gt;Azure OpenAI v1&lt;/strong&gt;. The difference is where the deployment name lives.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Azure OpenAI&lt;/strong&gt;, the deployment name stays in the URL path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST {gateway}/{base-path}/openai/deployments/{deployment}/chat/completions?api-version=2024-12-01-preview
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the other two, the deployment name moves into the request body. That sounds like a trivial difference. It isn't, because the official &lt;code&gt;AzureOpenAI&lt;/code&gt; Python SDK builds the first shape. Choose either of the other options and you are rewriting every client, not changing a URL.&lt;/p&gt;

&lt;p&gt;Pick &lt;strong&gt;Azure OpenAI&lt;/strong&gt; unless you have a specific reason not to. Your app code then changes by exactly one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AzureOpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2024-12-01-preview&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;azure_endpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://your-gateway.example.com/ai-prod&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# was the Foundry URL
&lt;/span&gt;    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GATEWAY_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;                          &lt;span class="c1"&gt;# was the Foundry key
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK appends &lt;code&gt;/openai/deployments/...&lt;/code&gt; itself.&lt;/p&gt;

&lt;p&gt;There's a bonus hidden in this choice. Because the deployment name is a path segment, it behaves as a wildcard. Deploy a new model on the same Foundry resource, and it is immediately reachable through the gateway with no new API, no second wizard run, no config change. We only discovered this by asking; it's not obvious from the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  The base path is forever
&lt;/h2&gt;

&lt;p&gt;The wizard asks for a base path and leaves the field blank. Everything else on that screen you can change later. This one you effectively cannot, because it becomes part of every client's URL.&lt;/p&gt;

&lt;p&gt;Two rules. Make it lowercase and hyphenated, because base paths are case-sensitive and mixed case generates 404s that people waste an afternoon on. And make it specific rather than generic. &lt;code&gt;openai&lt;/code&gt; feels natural until you onboard a second Foundry resource and discover the name is taken on that gateway instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  The default token limit is a trap
&lt;/h2&gt;

&lt;p&gt;Tick "manage token consumption" and the TPM field pre-fills with &lt;strong&gt;1000&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our deployment quota was 250,000 TPM. With &lt;code&gt;max_tokens: 4096&lt;/code&gt;, a single verbose response can consume a meaningful fraction of 1000 tokens, so you'll start seeing 429s within a handful of test calls and reasonably conclude the gateway is broken.&lt;/p&gt;

&lt;p&gt;Go and read your actual deployment quota first. Then set the gateway limit &lt;strong&gt;at or below&lt;/strong&gt; it. Above is worse than useless: API Management forwards the traffic, the model throws the 429 instead, and you get the outage without the protection, with the error surfacing from the backend where it's harder to attribute. We set ours to 125,000, half the quota, leaving room to onboard a second consumer without touching the deployment.&lt;/p&gt;

&lt;p&gt;Two settings on that screen deserve more attention than they get:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limit by: Subscription.&lt;/strong&gt; This makes the allowance per gateway key, so each app has its own bucket. The alternative, IP address, is wrong for most deployments because your apps will call from a small pool of shared outbound addresses and collide into a single bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Estimate prompt tokens: on.&lt;/strong&gt; With it off, the policy can only count tokens after the response returns, so a burst of concurrent requests all pass the check before any of them report. Worse: for streamed responses it can't count at all unless the client sends &lt;code&gt;stream_options: {"include_usage": true}&lt;/code&gt;. Most client code doesn't. With estimation off, streaming calls quietly bypass your limit entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metrics dimensions: fewer than you think
&lt;/h2&gt;

&lt;p&gt;The wizard offers nine dimensions to slice token metrics by, and it's tempting to take them all. We did, briefly.&lt;/p&gt;

&lt;p&gt;Application Insights bills per unique combination of dimension values. Most of those dimensions are constants in a single-instance, single-API setup, so you pay for cardinality that tells you nothing.&lt;/p&gt;

&lt;p&gt;Two are worth having:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subscription ID&lt;/strong&gt;: which application spent the tokens. This is the chargeback dimension and the whole point of the exercise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API ID&lt;/strong&gt;: constant today, essential the moment you add a second Foundry resource.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Skip &lt;strong&gt;Client IP&lt;/strong&gt; (high cardinality, low information, since callers share outbound addresses), &lt;strong&gt;User ID&lt;/strong&gt; (empty unless you're doing per-user JWT auth at the gateway), and &lt;strong&gt;Gateway ID&lt;/strong&gt; / &lt;strong&gt;Location&lt;/strong&gt; (constant for a single instance).&lt;/p&gt;

&lt;p&gt;Worth knowing before you decide: Application Insights data isn't retroactive. Metrics already emitted keep their original dimensions. So adding a dimension later means old and new data can't be compared cleanly, and removing one leaves a split in your history. Get it roughly right at the start.&lt;/p&gt;

&lt;h2&gt;
  
  
  There are two different Application Insights connections
&lt;/h2&gt;

&lt;p&gt;This one cost us a debugging session.&lt;/p&gt;

&lt;p&gt;The token metric policy and the request telemetry logger are separate mechanisms, configured in different places, and having one does not give you the other.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;token metric policy&lt;/strong&gt; is set up in the wizard. It emits prompt, completion, and total token counts.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;request logger&lt;/strong&gt; is a per-API setting under Settings, Diagnostics Logs. It captures status codes, latency, which operation was called, and failures. It has its own destination field, which starts empty.&lt;/p&gt;

&lt;p&gt;So after the wizard we could see exactly how many tokens a request consumed, but not that it had returned a 500 or taken twelve seconds. When we hit our first error, there was nothing useful to look at.&lt;/p&gt;

&lt;p&gt;Set both. On the request logger, set sampling to 100% for a low-volume API, tick "always log errors", and switch the correlation protocol from Legacy to &lt;strong&gt;W3C&lt;/strong&gt;, which is what lets you trace a request end to end across the edge, the gateway, and the backend. Leave "payload bytes to log" at 0 unless you're actively debugging, because raising it puts prompt and response content into your logs.&lt;/p&gt;

&lt;p&gt;One more thing that surprised us: the request logger is instance-wide by default, so telemetry from unrelated APIs on the same gateway lands in the same Application Insights resource. That's not a bug. Operations are prefixed with the API ID, so filtering is trivial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requests
| where operation_Name startswith "your-ai-api"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only place it genuinely bites is alerting. An alert on "average duration over 5 seconds" is meaningless when one API responds in 100ms and the other takes 8 seconds. Scope alerts by operation name, not on the blended instance average.&lt;/p&gt;

&lt;h2&gt;
  
  
  Semantic caching is where the wizard falls apart
&lt;/h2&gt;

&lt;p&gt;This is the feature with the longest prerequisite chain, and the wizard will not tell you what's missing until you're several screens in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Your existing Redis almost certainly won't work
&lt;/h3&gt;

&lt;p&gt;Semantic caching needs a vector index, which means Redis with the &lt;strong&gt;RediSearch&lt;/strong&gt; module. We had a Redis instance already, running happily as a cache for another system. Its module list read &lt;code&gt;RedisJSON, RedisTimeSeries, RedisBloom&lt;/code&gt;. No RediSearch.&lt;/p&gt;

&lt;p&gt;Modules are fixed at creation time. You cannot add RediSearch to an existing instance. You create a new one.&lt;/p&gt;

&lt;h3&gt;
  
  
  RediSearch conflicts with OSS clustering
&lt;/h3&gt;

&lt;p&gt;Creating that new instance, we ticked RediSearch and immediately got:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;OSSCluster Cluster Policy doesn't support the selected module(s): RediSearch&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fix is one click: change &lt;strong&gt;Clustering Policy&lt;/strong&gt; from &lt;code&gt;OSS&lt;/code&gt; to &lt;code&gt;Enterprise&lt;/code&gt;. Enterprise clustering hides sharding from the client, which is what the search module requires.&lt;/p&gt;

&lt;h3&gt;
  
  
  You can't set an eviction policy, and that matters
&lt;/h3&gt;

&lt;p&gt;With RediSearch enabled, the eviction policy dropdown offers exactly one option: &lt;strong&gt;No Eviction&lt;/strong&gt;. Azure locks it, because the search index needs its data present to stay consistent.&lt;/p&gt;

&lt;p&gt;The consequence is easy to miss. Your cache will not self-clean. When it fills, Redis starts &lt;strong&gt;rejecting writes&lt;/strong&gt; rather than dropping old entries. So the cache duration you set in the API Management policy stops being a tuning knob and becomes the only thing preventing unbounded growth. We used 3600 seconds. Size the instance with headroom.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;InsufficientCapacity&lt;/code&gt; is a region problem, not a config problem
&lt;/h3&gt;

&lt;p&gt;Our first three deployment attempts failed with a generic &lt;code&gt;Conflict&lt;/code&gt; / &lt;code&gt;ResourceDeploymentFailure&lt;/code&gt;. The portal's error summary was useless. The &lt;strong&gt;Raw Error&lt;/strong&gt; tab had the real answer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"InsufficientCapacity"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Request failed due to insufficient capacity. Retry using a different Azure Managed Redis size or region."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always open Raw Error. The summary is a wrapper.&lt;/p&gt;

&lt;p&gt;Two levers: change the size, or change the region. Note that changing size within the same performance tier often doesn't help, because those SKUs draw from the same capacity pool. Switching performance tier (Balanced to Memory Optimized, say) is more likely to find capacity than stepping from B0 to B1.&lt;/p&gt;

&lt;p&gt;We eventually provisioned in a different region, which leads directly to the next mistake.&lt;/p&gt;

&lt;h3&gt;
  
  
  The external cache has a region field, and it's not decorative
&lt;/h3&gt;

&lt;p&gt;Registering Redis as API Management's external cache asks you which gateway location "uses" this cache. Ours defaulted to the region the Redis instance was in, which was not the region the gateway was in. If no gateway location matches, the cache may never be used at all, silently. Set it to your gateway's region, or &lt;code&gt;Default&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also worth understanding: external cache registration is &lt;strong&gt;instance-wide&lt;/strong&gt;, but &lt;em&gt;using&lt;/em&gt; it is &lt;strong&gt;per-API&lt;/strong&gt;. Registering the cache doesn't change the behaviour of any existing API, because nothing touches Redis unless a policy says so.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-region caching may cost more than it saves
&lt;/h3&gt;

&lt;p&gt;We ended up with the gateway in one continent and Redis in another. Roughly 200ms of round trip added to &lt;strong&gt;every&lt;/strong&gt; request, hits and misses alike.&lt;/p&gt;

&lt;p&gt;On a cache miss, that's ~200ms added to a call already taking 1 to 2 seconds. Annoying, survivable. On a hit, you still come out well ahead. The place it genuinely hurts is streaming, where the full round trip lands on time-to-first-token, which is the latency users actually perceive.&lt;/p&gt;

&lt;p&gt;But the real question isn't latency. It's whether your prompts repeat at all. Semantic caching pays an embedding call on &lt;strong&gt;100%&lt;/strong&gt; of requests to get a saving on some fraction of them. If your traffic is mostly unique prompts, you're paying for nothing. Measure your hit rate before you defend the architecture.&lt;/p&gt;

&lt;p&gt;I should also correct something I believed going in. I assumed Redis Enterprise with search would cost several hundred dollars a month, and used that to argue against the whole feature. Azure Managed Redis at the entry tier came in around &lt;strong&gt;$25/month&lt;/strong&gt;. That's a materially different calculation, and it changed my recommendation. Check current pricing rather than trusting a number you remember.&lt;/p&gt;

&lt;h3&gt;
  
  
  The embeddings backend the wizard forgets to create
&lt;/h3&gt;

&lt;p&gt;This one produced our only hard failure.&lt;/p&gt;

&lt;p&gt;The semantic cache lookup policy references an embeddings backend by ID. That backend needs to exist as a registered API Management &lt;strong&gt;Backend&lt;/strong&gt;, pointing at an embeddings deployment. The wizard normally creates it for you.&lt;/p&gt;

&lt;p&gt;Ours didn't, because the wizard aborted partway through with a benign-looking error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Error setting up semantic caching. The role assignment already exists.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The role assignment conflict was harmless. An earlier attempt had already granted the gateway's managed identity the right role. But the wizard treated it as fatal, stopped, and never created the backend or added the policies.&lt;/p&gt;

&lt;p&gt;We added the policies by hand and got a clean &lt;strong&gt;500 Internal Server Error&lt;/strong&gt; on every request, in about 800ms, far too fast to have reached the model. The lookup policy was throwing because &lt;code&gt;embeddings-backend&lt;/code&gt; didn't resolve.&lt;/p&gt;

&lt;p&gt;The fix: create the backend manually as a Custom URL, with the name matching the policy exactly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;https://&amp;lt;your-resource&amp;gt;.openai.azure.com/openai/deployments/text-embedding-3-small/embeddings
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two lessons. First, if the wizard reports &lt;em&gt;any&lt;/em&gt; error, go and verify what it actually created; don't assume a partial failure is a partial success. Second, and more generally: &lt;strong&gt;add one policy at a time and test between each&lt;/strong&gt;. We added two policies and a backend dependency in one go, then had to bisect. Getting a single successful &lt;code&gt;200&lt;/code&gt; before layering anything on would have made the failure obvious immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  The policy order, and what it means
&lt;/h2&gt;

&lt;p&gt;The finished inbound chain, in execution order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Validate the gateway key&lt;/strong&gt; against the product. An unrecognised key is rejected here, before any Azure resource is touched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic cache lookup.&lt;/strong&gt; Embed the prompt, search Redis. A match above the similarity threshold returns the stored answer and steps 3 and 4 never run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token rate limit.&lt;/strong&gt; Count the call against that key's allowance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Emit token metrics.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route to the backend&lt;/strong&gt; using the gateway's managed identity.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And on the way out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Semantic cache store&lt;/strong&gt;, writing the answer and its vector back to Redis.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The sequencing is deliberate: cheap rejections first, cache before the expensive call, and no credential anywhere in the path.&lt;/p&gt;

&lt;p&gt;One thing worth internalising: a cache miss now costs you an &lt;strong&gt;embedding call plus a model call&lt;/strong&gt;. Add content safety screening and you have three service round trips before the model sees the prompt. That's the honest price of a governed gateway. It's usually worth it. Just don't be surprised by the latency and go looking for a bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Similarity threshold: trust the description, not the warning
&lt;/h2&gt;

&lt;p&gt;Setting the threshold, the portal showed us this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Similarity score threshold above 0.2 may lead to cache mismatch. Consider using lower value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is backwards, at least as worded. The field description says similarity, where 1.0 is an exact match. A &lt;strong&gt;higher&lt;/strong&gt; threshold means stricter matching and fewer false hits. A &lt;strong&gt;lower&lt;/strong&gt; threshold is what causes mismatches: at 0.2 almost any two prompts would look similar and you'd cheerfully serve a user the answer to a question they didn't ask.&lt;/p&gt;

&lt;p&gt;We started at 0.9. Start strict, watch your hit rate, and lower it deliberately if hits are too rare. This is the one setting where a wrong value produces &lt;em&gt;plausible but incorrect&lt;/em&gt; output rather than an error, which makes it the most dangerous knob on the page.&lt;/p&gt;

&lt;p&gt;Also worth scoping the cache per key with a &lt;code&gt;vary-by&lt;/code&gt; on the subscription. Otherwise one application's answers can be served to another.&lt;/p&gt;

&lt;h2&gt;
  
  
  The header rename that saves you a rewrite
&lt;/h2&gt;

&lt;p&gt;API Management expects its key in an &lt;code&gt;Ocp-Apim-Subscription-Key&lt;/code&gt; header. The &lt;code&gt;AzureOpenAI&lt;/code&gt; SDK sends credentials in an &lt;code&gt;api-key&lt;/code&gt; header.&lt;/p&gt;

&lt;p&gt;You can work around this in client code with &lt;code&gt;default_headers&lt;/code&gt;, but there's a cleaner option: under the API's Settings, rename the subscription header to &lt;strong&gt;&lt;code&gt;api-key&lt;/code&gt;&lt;/strong&gt;. Now the SDK works unchanged and your app diff is genuinely one line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Products and subscriptions: badly named, load-bearing
&lt;/h2&gt;

&lt;p&gt;The terminology here trips people up, so plainly:&lt;/p&gt;

&lt;p&gt;An API Management &lt;strong&gt;subscription&lt;/strong&gt; has nothing to do with an Azure subscription. It's an API key.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;product&lt;/strong&gt; is a bundle of APIs plus access rules. A &lt;strong&gt;subscription&lt;/strong&gt; is a key issued against a product. So: product contains your API, you create a subscription on the product, it generates a key, the app sends the key.&lt;/p&gt;

&lt;p&gt;This isn't optional decoration. Two of the settings you already configured point at nothing without it: &lt;code&gt;Limit by: Subscription&lt;/code&gt; has no subscriptions to count per, and the Subscription ID metrics dimension has nothing to record. And of course without a key nobody can call the API at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mistake that makes all of this decorative
&lt;/h2&gt;

&lt;p&gt;Here's the one that matters most, and it's the easiest to skip because everything appears to be working.&lt;/p&gt;

&lt;p&gt;When you finish, you have a governed gateway. You also still have the original Foundry endpoint, with its original keys, publicly reachable, bypassing every control you just built. Anyone holding a copy of that key gets no rate limit, no metrics, no cache, no attribution.&lt;/p&gt;

&lt;p&gt;Your gateway is optional. And an optional control is not a control.&lt;/p&gt;

&lt;p&gt;There are two ways to close it, with very different effort profiles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disable local key authentication.&lt;/strong&gt; The endpoint stays publicly reachable, so the gateway keeps working unchanged (it authenticates with its managed identity, not a key), but the API keys stop working entirely.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az cognitiveservices account update &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--name&lt;/span&gt; &amp;lt;your-foundry-resource&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--resource-group&lt;/span&gt; &amp;lt;your-rg&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--custom-domain&lt;/span&gt; &amp;lt;your-foundry-resource&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--api-properties&lt;/span&gt; &lt;span class="nv"&gt;disableLocalAuth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Or disable public network access&lt;/strong&gt; and put a private endpoint in front of it. Stronger, because it removes the public attack surface entirely rather than just the key path. But it's a real project: private endpoint, private DNS zone linked to the VNet, and gateway VNet integration, which requires a Standard v2 or Premium v2 tier. If you're on a lower tier, this becomes a SKU migration with a cost attached.&lt;/p&gt;

&lt;p&gt;If you go the private route, &lt;strong&gt;audit callers before disabling local auth&lt;/strong&gt;, and do it last in the sequence. If some forgotten script or integration is hitting the model with a key today, it breaks the moment you flip that switch, silently and at whatever time of day you happened to run the command.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Prove the base path works before adding anything.&lt;/strong&gt; One successful &lt;code&gt;200&lt;/code&gt; through the gateway, with nothing but key validation in the chain. Then add the token limit, test. Then metrics, test. Then caching, test. We stacked four unproven dependencies and spent longer bisecting than the sequential approach would have taken.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read the raw error, always.&lt;/strong&gt; The portal's error summaries are wrappers around the useful message.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify what the wizard claims to have built.&lt;/strong&gt; A partial failure looks a lot like success from the notifications panel. Check the policy XML. Check the backends list. Check the role assignment landed on the target resource.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decide about direct access on day one.&lt;/strong&gt; Not as a follow-up task. Until the bypass is closed, you have built a dashboard, not a gateway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ask the data residency question out loud.&lt;/strong&gt; Semantic caching stores prompt text and responses. If your organisation deliberately chose a region for compliance reasons, a cache in a different geography is a real change to where data lives, not an implementation detail. It's the item least likely to surface on its own and most likely to become a problem later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Was it worth it?
&lt;/h2&gt;

&lt;p&gt;Yes, and not marginally.&lt;/p&gt;

&lt;p&gt;The end state: every application holds its own revocable key, no application holds a credential for the model, spend is capped per application and attributable to the team that caused it, repeated questions are served from cache instead of being paid for twice, and there's one place to look when something breaks.&lt;/p&gt;

&lt;p&gt;The build took an afternoon. Most of that afternoon was the dozen small things above, none of which are in the quickstart. Now that you know about them, it should take you an hour.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>ai</category>
    </item>
    <item>
      <title>Promotable, Deployable, Rotatable: Making Bench Management an Actual Process</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Thu, 27 Aug 2026 13:57:52 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/promotable-deployable-rotatable-making-bench-management-an-actual-process-5b2a</link>
      <guid>https://dev.to/vicky_acedia/promotable-deployable-rotatable-making-bench-management-an-actual-process-5b2a</guid>
      <description>&lt;p&gt;Every services organisation has a bench — people between projects, waiting on a client start date, rolling off an engagement that ended early, or parked because the skill they have and the skill the market wants have drifted apart. The bench is not a defect. It's the cost of being able to say yes to work you haven't won yet.&lt;/p&gt;

&lt;p&gt;What &lt;em&gt;is&lt;/em&gt; a defect is not knowing anything useful about the people on it.&lt;/p&gt;

&lt;p&gt;The usual state of affairs is a spreadsheet with a name, a skill string, a rate, and a date. That tells you who is unallocated. It tells you nothing about what to &lt;em&gt;do&lt;/em&gt; about it. So the conversation in the weekly review becomes a series of individual negotiations, driven by whoever in the room happens to remember something about that person. Decisions don't accumulate. Six weeks later you have the same conversation about the same person, and nobody can reconstruct why the last one went the way it did.&lt;/p&gt;

&lt;p&gt;PDR is one way out of that. It's a small idea, and most of the value is in the discipline it forces rather than the taxonomy itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three dispositions
&lt;/h2&gt;

&lt;p&gt;PDR classifies each person on the bench against three questions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promotable&lt;/strong&gt; — is this person ready to move up a level? Not "are they good," but: is there evidence they are already operating above their current band, and would a promotion make them easier to place at a higher billing rate?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployable&lt;/strong&gt; — can this person be put on billable work as-is, right now, with no intervention? This is the most misread of the three. Deployable is not a compliment. It means the skills match live demand and there is nothing blocking a start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rotatable&lt;/strong&gt; — should this person move to a different technology, domain, or vertical? Rotation is the answer when someone is capable but their current specialisation has no pipeline behind it.&lt;/p&gt;

&lt;p&gt;The point of three separate axes is that they are not mutually exclusive and they are not a ranking. Someone can be promotable &lt;em&gt;and&lt;/em&gt; rotatable — a strong senior engineer in a dying stack. Someone can be deployable but not promotable — solid, well-matched, not ready for the next band. Someone can be none of the three, and that is the most important signal the framework produces, because it means the situation needs a decision that isn't "wait."&lt;/p&gt;

&lt;p&gt;The moment you collapse this into a single label — a tier, a grade, an A/B/C — you lose exactly the information you built the system to capture.&lt;/p&gt;

&lt;h2&gt;
  
  
  The process
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Intake
&lt;/h3&gt;

&lt;p&gt;Bench entries come from allocation data, not from manual entry. If someone has to remember to add a person, the list will be wrong within a week. The system should derive the bench from the absence of active billable allocation, then let humans annotate.&lt;/p&gt;

&lt;p&gt;Intake also needs a start date for the bench period. Aging is the single most predictive field you have, and it only works if the clock starts automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Assessment
&lt;/h3&gt;

&lt;p&gt;Someone with actual knowledge of the person marks the three flags. This is usually a delivery lead or a resource manager, not HR and not a tool.&lt;/p&gt;

&lt;p&gt;Two design decisions matter more than they sound:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unassessed must look different from assessed-and-negative.&lt;/strong&gt; "Not promotable" and "nobody has looked at this yet" are completely different facts, and a UI that renders both as an empty checkbox will quietly destroy your data quality. Blank means unknown. Show it as unfinished.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every negative or unusual combination needs a justification.&lt;/strong&gt; Not a dropdown — free text, required, at the point of assessment. This is the gate that turns the framework from a labelling exercise into a decision record. It also slows people down, which is the intended effect. If marking someone as not deployable takes two seconds, it will be done thoughtlessly and often.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Action
&lt;/h3&gt;

&lt;p&gt;A classification with no downstream action is theatre. Each disposition should route somewhere concrete:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Promotable → into the next promotion cycle with the justification attached as evidence&lt;/li&gt;
&lt;li&gt;Deployable → into active matching against open demand&lt;/li&gt;
&lt;li&gt;Rotatable → into a reskilling track with a named target skill and a timeline&lt;/li&gt;
&lt;li&gt;None of the above → escalation, with a review date&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fourth case is the one organisations avoid building. It's also the one that determines whether the whole exercise is honest.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Audit
&lt;/h3&gt;

&lt;p&gt;Every assessment change is appended, never overwritten. Who changed what, when, from what to what, and why. Append-only, no edits, no deletes.&lt;/p&gt;

&lt;p&gt;This is non-negotiable for two reasons. The obvious one is that these records touch promotion, reassignment, and eventually separation decisions, and you will be asked to explain them. The less obvious one is that the history is where the actual insight lives. A person marked rotatable four quarters running, with four justifications, is telling you something about your reskilling programme, not about the person.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually goes wrong
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Coverage gets measured instead of accuracy.&lt;/strong&gt; "94% of the bench is assessed" is a number that goes up when people click things. It says nothing about whether the assessments are right. Coverage is a hygiene metric — worth a single indicator, not a dashboard. If your reporting makes coverage the headline, you have built an incentive to fill in boxes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployable becomes the default.&lt;/strong&gt; Marking someone deployable is the path of least resistance: it's positive, it needs no justification, it moves the problem to the matching team. Watch the distribution. If deployable is running above 70% of assessed bench while placement rates stay flat, the flag has stopped meaning anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assessments go stale.&lt;/strong&gt; A three-month-old assessment is a guess. Build in expiry — an assessment older than a defined window reverts to unassessed rather than continuing to display as fact. People will hate this. Do it anyway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rotation is recommended without capacity to deliver it.&lt;/strong&gt; Marking someone rotatable is free. Actually retraining them costs money, bench time, and a mentor. If rotation recommendations exceed reskilling capacity by 5x, the flag is a way of deferring a harder conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The framework gets used as a performance tool.&lt;/strong&gt; PDR describes &lt;em&gt;market fit and placement readiness&lt;/em&gt;. It is not a performance rating, and the two must not be joined. A high performer in a technology with no demand is not deployable, and if your system lets that read as a performance signal, you will lose good people and deserve to.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest framing
&lt;/h2&gt;

&lt;p&gt;PDR is a decision-forcing device, not an optimisation engine. It won't tell you what to do with anyone. What it does is make the absence of a decision visible — an unassessed row, a stale assessment, a person marked rotatable for three quarters with no training assigned. That visibility is uncomfortable, which is the entire point, and it's also the reason most implementations quietly drift toward measuring completion rates instead.&lt;/p&gt;

&lt;p&gt;If you're building something like this, the test isn't whether the dashboard looks good. It's whether the weekly bench review is shorter and produces fewer repeat conversations than it did before. If a person's situation comes up twice with no change in between, the system failed regardless of how much of the bench is "covered."&lt;/p&gt;

&lt;p&gt;One last thing worth saying plainly: these are people, and the labels are blunt. "Not deployable" is a statement about a market, a skills pipeline, and a sales pipeline — three things the individual mostly doesn't control. Build the justification field wide, require it, and read what people write in it. That text is usually a more accurate description of your organisation's problems than of the person's.&lt;/p&gt;

</description>
      <category>process</category>
    </item>
    <item>
      <title>CI/CD for Azure Logic Apps Standard on a Private (ILB) ASE — Without a VNet Agent</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Wed, 26 Aug 2026 04:19:58 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/cicd-for-azure-logic-apps-standard-on-a-private-ilb-ase-without-a-vnet-agent-1j2e</link>
      <guid>https://dev.to/vicky_acedia/cicd-for-azure-logic-apps-standard-on-a-private-ilb-ase-without-a-vnet-agent-1j2e</guid>
      <description>&lt;p&gt;&lt;em&gt;How we wired an Azure DevOps pipeline to a Logic App Standard running on an internal App Service Environment, hit six real-world failures on the way, and ended with a deployment that needs no SAS tokens, no SCM access, and no VNet-connected build agent.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Logic Apps Standard on an &lt;strong&gt;ILB App Service Environment (ASE v3)&lt;/strong&gt; has no public SCM (Kudu) endpoint. That kills the two "normal" deployment routes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Why it fails on ILB ASE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;az webapp deploy&lt;/code&gt; / zip-deploy from a Microsoft-hosted agent&lt;/td&gt;
&lt;td&gt;Talks to the SCM endpoint, which is private&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VS Code / portal publish&lt;/td&gt;
&lt;td&gt;Same SCM dependency, plus it isn't CI/CD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The usual answer is "stand up a self-hosted agent inside the VNet." That's the right long-term answer — but you can ship &lt;strong&gt;today&lt;/strong&gt; without it, using &lt;strong&gt;Run-From-Package with a managed-identity-authenticated blob URL&lt;/strong&gt;. The pipeline only ever talks to two public planes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Azure Storage&lt;/strong&gt; (upload the package)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ARM / management.azure.com&lt;/strong&gt; (set one app setting, restart the app)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The app then pulls the package itself, from inside the VNet, using its own managed identity. SCM is never touched. No SAS token ever exists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git push ──▶ ADO pipeline ──▶ zip ──▶ Blob Storage
                                          ▲
                                          │ (pull via app's
                                          │  managed identity)
             ARM: set app setting ──▶ Logic App (ILB ASE)
             ARM: restart app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What you need before starting
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Prerequisite&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Logic App Standard resource, &lt;strong&gt;Started&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;A stopped app silently accepts settings and deploys nothing. Check the Overview blade — ours had been sitting in &lt;code&gt;Stopped&lt;/code&gt; and cost us a confused hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;A storage account the ASE can reach&lt;/td&gt;
&lt;td&gt;Same region as the ASE. Public network access enabled is the simple path; a private endpoint works too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;A blob container, private access&lt;/td&gt;
&lt;td&gt;e.g. &lt;code&gt;deployments&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;An ADO agent (hosted or self-hosted) with &lt;strong&gt;Azure CLI installed&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Ours was a Windows self-hosted box that did &lt;em&gt;not&lt;/em&gt; have &lt;code&gt;az&lt;/code&gt; — see failure #3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;An ARM service connection&lt;/td&gt;
&lt;td&gt;Any auth type works. If it's the &lt;strong&gt;"Managed identity (agent-assigned)"&lt;/strong&gt; type, the identity must actually be enabled on the agent VM — see failure #2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Rights to create role assignments on the storage account and the Logic App's resource group&lt;/td&gt;
&lt;td&gt;Or a friendly admin&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Step 1 — Repository layout
&lt;/h2&gt;

&lt;p&gt;One folder per Logic App Standard resource; one subfolder per workflow. The zip we deploy is simply the app folder's contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;logicapps-platform/&lt;/span&gt;
&lt;span class="s"&gt;├── apps/&lt;/span&gt;
&lt;span class="s"&gt;│   └── la-integration-prod/          ← 1 folder = 1 Logic App Standard resource&lt;/span&gt;
&lt;span class="s"&gt;│       ├── host.json                 ← runtime + extension bundle&lt;/span&gt;
&lt;span class="s"&gt;│       ├── connections.json          ← connector references ({} to start)&lt;/span&gt;
&lt;span class="s"&gt;│       ├── parameters.json           ← per-environment values ({} to start)&lt;/span&gt;
&lt;span class="s"&gt;│       ├── .funcignore&lt;/span&gt;
&lt;span class="s"&gt;│       └── Heartbeat-Test/           ← 1 folder = 1 workflow&lt;/span&gt;
&lt;span class="s"&gt;│           └── workflow.json&lt;/span&gt;
&lt;span class="s"&gt;└── pipelines/&lt;/span&gt;
    &lt;span class="s"&gt;└── deploy-la-integration-prod.yml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;host.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extensionBundle"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Microsoft.Azure.Functions.ExtensionBundle.Workflows"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"[1.*, 2.0.0)"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;connections.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"managedApiConnections"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"serviceProviderConnections"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Heartbeat-Test/workflow.json&lt;/code&gt; — a deliberately trivial pilot workflow. No connectors, no secrets, nothing that can fail for reasons unrelated to the pipeline. Prove the pipe first; migrate real workflows second.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"definition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"contentVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"triggers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Every_Hour"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Recurrence"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"recurrence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"frequency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hour"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"interval"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"actions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Compose_Heartbeat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Compose"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"inputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Deployed via ADO pipeline"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"runAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@{utcNow()}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"workflow"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@{workflow().name}"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"runAfter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"outputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Stateful"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Path gotcha:&lt;/strong&gt; if your files live in a subfolder of the repo (e.g. &lt;code&gt;myrepo/logicapps-platform/apps/...&lt;/code&gt;), the pipeline's &lt;code&gt;sourceFolder&lt;/code&gt; variable and trigger paths must include that prefix. Our first run failed with &lt;code&gt;Cannot find path ...\apps\&lt;/code&gt; for exactly this reason.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 2 — Identity and role assignments
&lt;/h2&gt;

&lt;p&gt;Three grants total. Two for the &lt;strong&gt;pipeline's identity&lt;/strong&gt; (whatever your service connection authenticates as), one for the &lt;strong&gt;Logic App's own identity&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2a. Pipeline identity
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Scope&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Storage Blob Data Contributor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The storage account&lt;/td&gt;
&lt;td&gt;Upload the package&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Website Contributor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The Logic App's resource group&lt;/td&gt;
&lt;td&gt;Set app settings + restart&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az role assignment create &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Storage Blob Data Contributor"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--assignee-object-id&lt;/span&gt; &amp;lt;pipeline-identity-object-id&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--assignee-principal-type&lt;/span&gt; ServicePrincipal &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--scope&lt;/span&gt; &lt;span class="s2"&gt;"/subscriptions/&amp;lt;sub-id&amp;gt;/resourceGroups/&amp;lt;storage-rg&amp;gt;/providers/Microsoft.Storage/storageAccounts/&amp;lt;storage-account&amp;gt;"&lt;/span&gt;

az role assignment create &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Website Contributor"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--assignee-object-id&lt;/span&gt; &amp;lt;pipeline-identity-object-id&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--assignee-principal-type&lt;/span&gt; ServicePrincipal &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--scope&lt;/span&gt; &lt;span class="s2"&gt;"/subscriptions/&amp;lt;sub-id&amp;gt;/resourceGroups/&amp;lt;logicapp-rg&amp;gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to find the pipeline identity's object ID when nobody remembers it:&lt;/strong&gt; run a throwaway pipeline on the target pool that asks the instance metadata service directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;none&lt;/span&gt;
&lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;SelfHosted-Windows-Pool'&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;powershell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;$r = Invoke-RestMethod -Headers @{Metadata="true"} -Uri "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=https://management.azure.com/"&lt;/span&gt;
    &lt;span class="s"&gt;$p = $r.access_token.Split('.')[1].Replace('-','+').Replace('_','/')&lt;/span&gt;
    &lt;span class="s"&gt;switch ($p.Length % 4) { 2 {$p+='=='}; 3 {$p+='='} }&lt;/span&gt;
    &lt;span class="s"&gt;$c = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($p)) | ConvertFrom-Json&lt;/span&gt;
    &lt;span class="s"&gt;Write-Host "objectId : $($c.oid)"&lt;/span&gt;
    &lt;span class="s"&gt;Write-Host "resource : $($c.xms_mirid)"   # full ARM ID of the VM - tells you where it lives&lt;/span&gt;
  &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Who am I&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this returns &lt;code&gt;Identity not found&lt;/code&gt;, the agent VM's system-assigned identity is &lt;strong&gt;off&lt;/strong&gt; — enable it (VM → Identity → System assigned → On) and note the object ID it produces. This exact thing happened to us: the MI-type service connection had existed for months and had &lt;em&gt;never worked&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2b. Logic App identity (the key to SAS-free deployment)
&lt;/h3&gt;

&lt;p&gt;Enable the app's system-assigned identity (Logic App → Identity → System assigned → On), then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az role assignment create &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Storage Blob Data Reader"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--assignee-object-id&lt;/span&gt; &amp;lt;logicapp-identity-object-id&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--assignee-principal-type&lt;/span&gt; ServicePrincipal &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--scope&lt;/span&gt; &lt;span class="s2"&gt;"/subscriptions/&amp;lt;sub-id&amp;gt;/resourceGroups/&amp;lt;storage-rg&amp;gt;/providers/Microsoft.Storage/storageAccounts/&amp;lt;storage-account&amp;gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;RBAC propagation is real.&lt;/strong&gt; Allow ~5 minutes between creating a role assignment and testing it. Restarting the app 30 seconds after the grant gives a false failure.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 3 — The pipeline
&lt;/h2&gt;

&lt;p&gt;The complete, working YAML. Written for a &lt;strong&gt;Windows&lt;/strong&gt; agent (all steps PowerShell); on a Linux agent, switch &lt;code&gt;scriptType: ps&lt;/code&gt; to &lt;code&gt;bash&lt;/code&gt; and adjust the validation step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ============================================================================&lt;/span&gt;
&lt;span class="c1"&gt;# Deploy Logic App Standard via Run-From-Package (Blob, MI-authenticated URL)&lt;/span&gt;
&lt;span class="c1"&gt;# The app pulls the package with ITS OWN managed identity: no SAS, no expiry,&lt;/span&gt;
&lt;span class="c1"&gt;# and the SCM endpoint is never touched, so an ILB ASE is not a problem.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# PREREQS:&lt;/span&gt;
&lt;span class="c1"&gt;#   - Logic App system-assigned identity ON, with 'Storage Blob Data Reader'&lt;/span&gt;
&lt;span class="c1"&gt;#     on the storage account&lt;/span&gt;
&lt;span class="c1"&gt;#   - Pipeline identity: 'Storage Blob Data Contributor' on the storage&lt;/span&gt;
&lt;span class="c1"&gt;#     account and 'Website Contributor' on the Logic App's resource group&lt;/span&gt;
&lt;span class="c1"&gt;# ============================================================================&lt;/span&gt;

&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;main&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;apps/la-integration-prod/**&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pipelines/**&lt;/span&gt;

&lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;SelfHosted-Windows-Pool'&lt;/span&gt;     &lt;span class="c1"&gt;# or vmImage: 'ubuntu-latest' for SP-auth connections&lt;/span&gt;

&lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;serviceConnection&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;my-azure-service-connection'&lt;/span&gt;
  &lt;span class="na"&gt;resourceGroup&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;     &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rg-logicapps-prod'&lt;/span&gt;
  &lt;span class="na"&gt;appName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;           &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;la-integration-prod'&lt;/span&gt;
  &lt;span class="na"&gt;storageAccount&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;    &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;stdeploypkgs'&lt;/span&gt;
  &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;         &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;deployments'&lt;/span&gt;
  &lt;span class="na"&gt;sourceFolder&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;      &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;apps/la-integration-prod'&lt;/span&gt;
  &lt;span class="na"&gt;packageName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;       &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;la-integration-prod-$(Build.BuildId).zip'&lt;/span&gt;

&lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="c1"&gt;# ----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
  &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Validate &amp;amp; package&lt;/span&gt;
  &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;job&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Package&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;powershell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;$bad = 0&lt;/span&gt;
        &lt;span class="s"&gt;Get-ChildItem -Path "$(sourceFolder)" -Recurse -Filter *.json | ForEach-Object {&lt;/span&gt;
          &lt;span class="s"&gt;$raw = Get-Content $_.FullName -Raw&lt;/span&gt;
          &lt;span class="s"&gt;try { $raw | ConvertFrom-Json | Out-Null }&lt;/span&gt;
          &lt;span class="s"&gt;catch { Write-Host "##vso[task.logissue type=error]Invalid JSON: $($_.FullName)"; $bad++ }&lt;/span&gt;
          &lt;span class="s"&gt;if ($raw -match '"(secret|client_secret|clientSecret|password)"\s*:\s*"(?!@)') {&lt;/span&gt;
            &lt;span class="s"&gt;Write-Host "##vso[task.logissue type=error]Inline secret in: $($_.FullName)"; $bad++&lt;/span&gt;
          &lt;span class="s"&gt;}&lt;/span&gt;
        &lt;span class="s"&gt;}&lt;/span&gt;
        &lt;span class="s"&gt;if ($bad -gt 0) { exit 1 }&lt;/span&gt;
      &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Validate JSON + block inline secrets&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ArchiveFiles@2&lt;/span&gt;
      &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Zip app content&lt;/span&gt;
      &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;rootFolderOrFile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(sourceFolder)'&lt;/span&gt;
        &lt;span class="na"&gt;includeRootFolder&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;          &lt;span class="c1"&gt;# host.json must sit at the ZIP ROOT&lt;/span&gt;
        &lt;span class="na"&gt;archiveType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;zip&lt;/span&gt;
        &lt;span class="na"&gt;archiveFile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(Build.ArtifactStagingDirectory)/$(packageName)'&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;publish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(Build.ArtifactStagingDirectory)/$(packageName)'&lt;/span&gt;
      &lt;span class="na"&gt;artifact&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;package&lt;/span&gt;

&lt;span class="c1"&gt;# ----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
  &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy to $(appName)&lt;/span&gt;
  &lt;span class="na"&gt;dependsOn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
  &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;deployment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;logicapps-prod'&lt;/span&gt;         &lt;span class="c1"&gt;# add an approval gate on this environment&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;runOnce&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;download&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;current&lt;/span&gt;
            &lt;span class="na"&gt;artifact&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;package&lt;/span&gt;

          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AzureCLI@2&lt;/span&gt;
            &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload package to blob&lt;/span&gt;
            &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;azureSubscription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(serviceConnection)'&lt;/span&gt;
              &lt;span class="na"&gt;scriptType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ps&lt;/span&gt;
              &lt;span class="na"&gt;scriptLocation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;inlineScript&lt;/span&gt;
              &lt;span class="na"&gt;inlineScript&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                &lt;span class="s"&gt;az storage blob upload `&lt;/span&gt;
                  &lt;span class="s"&gt;--account-name $(storageAccount) `&lt;/span&gt;
                  &lt;span class="s"&gt;--container-name $(container) `&lt;/span&gt;
                  &lt;span class="s"&gt;--name $(packageName) `&lt;/span&gt;
                  &lt;span class="s"&gt;--file "$(Pipeline.Workspace)/package/$(packageName)" `&lt;/span&gt;
                  &lt;span class="s"&gt;--auth-mode login --overwrite&lt;/span&gt;

          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AzureCLI@2&lt;/span&gt;
            &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Point app at package (MI-auth URL, no SAS, no SCM)&lt;/span&gt;
            &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;azureSubscription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(serviceConnection)'&lt;/span&gt;
              &lt;span class="na"&gt;scriptType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ps&lt;/span&gt;
              &lt;span class="na"&gt;scriptLocation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;inlineScript&lt;/span&gt;
              &lt;span class="na"&gt;inlineScript&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                &lt;span class="s"&gt;$ErrorActionPreference = "Stop"&lt;/span&gt;
                &lt;span class="s"&gt;$url = "https://$(storageAccount).blob.core.windows.net/$(container)/$(packageName)"&lt;/span&gt;

                &lt;span class="s"&gt;az webapp config appsettings set `&lt;/span&gt;
                  &lt;span class="s"&gt;-g "$(resourceGroup)" -n "$(appName)" `&lt;/span&gt;
                  &lt;span class="s"&gt;--settings WEBSITE_RUN_FROM_PACKAGE="$url" WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID="SystemAssigned" `&lt;/span&gt;
                  &lt;span class="s"&gt;-o none&lt;/span&gt;

                &lt;span class="s"&gt;az webapp restart -g "$(resourceGroup)" -n "$(appName)"&lt;/span&gt;
                &lt;span class="s"&gt;Write-Host "Deployed $(packageName). App restarted."&lt;/span&gt;

          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AzureCLI@2&lt;/span&gt;
            &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Verify workflow exists&lt;/span&gt;
            &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;azureSubscription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(serviceConnection)'&lt;/span&gt;
              &lt;span class="na"&gt;scriptType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ps&lt;/span&gt;
              &lt;span class="na"&gt;scriptLocation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;inlineScript&lt;/span&gt;
              &lt;span class="na"&gt;inlineScript&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                &lt;span class="s"&gt;Start-Sleep -Seconds 60&lt;/span&gt;
                &lt;span class="s"&gt;$sub = az account show --query id -o tsv&lt;/span&gt;
                &lt;span class="s"&gt;az rest --method GET `&lt;/span&gt;
                  &lt;span class="s"&gt;--uri "https://management.azure.com/subscriptions/$sub/resourceGroups/$(resourceGroup)/providers/Microsoft.Web/sites/$(appName)/workflows?api-version=2022-03-01" `&lt;/span&gt;
                  &lt;span class="s"&gt;--query "value[].name" -o tsv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three lines carry the whole trick:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;WEBSITE_RUN_FROM_PACKAGE&lt;/code&gt; = the &lt;strong&gt;plain&lt;/strong&gt; blob URL — no SAS query string.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID=SystemAssigned&lt;/code&gt; — tells App Service to fetch the package using the app's own managed identity. &lt;strong&gt;Without this setting the runtime attempts anonymous access, fails, and the app reports &lt;code&gt;ServiceUnavailable&lt;/code&gt; from the host runtime.&lt;/strong&gt; This is the single most-missed step.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;includeRootFolder: false&lt;/code&gt; in the archive task — &lt;code&gt;host.json&lt;/code&gt; must be at the root of the zip, not nested one level down.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 4 — Run it, and what "success" looks like
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create the pipeline from the YAML, run it. First run will pause to ask permission on the service connection / environment / pool — click &lt;strong&gt;Permit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Green pipeline, and the Verify step prints your workflow name(s).&lt;/li&gt;
&lt;li&gt;Portal → Logic App → &lt;strong&gt;Workflows&lt;/strong&gt; shows the workflow, &lt;code&gt;Stateful&lt;/code&gt;, &lt;code&gt;Enabled&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open it → &lt;strong&gt;Run history&lt;/strong&gt; → confirm a run actually executed with the expected output. A workflow that loads but never runs is not success.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Everything that actually went wrong (the useful part)
&lt;/h2&gt;

&lt;p&gt;Our path to green, in order. If you're debugging, scan this table first.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Root cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Unable to locate executable file: 'bash'&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Assumed Linux; the self-hosted agent was &lt;strong&gt;Windows&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;All steps → PowerShell (&lt;code&gt;scriptType: ps&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Invoke-RestMethod : {"error":"invalid_request","error_description":"Identity not found"}&lt;/code&gt; on the metadata endpoint&lt;/td&gt;
&lt;td&gt;Agent VM's system-assigned managed identity was &lt;strong&gt;off&lt;/strong&gt; — the MI-type service connection had never actually worked&lt;/td&gt;
&lt;td&gt;VM → Identity → System assigned → On. If the identity was enabled after boot, a VM restart may be needed before the token endpoint responds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Azure CLI 2.x is not installed on this machine&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fresh agent VM, no &lt;code&gt;az&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Install via portal &lt;strong&gt;Run Command&lt;/strong&gt; (no RDP needed), then restart the agent service so it picks up the new PATH:&lt;br&gt;&lt;code&gt;Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile C:\az.msi&lt;/code&gt;&lt;br&gt;&lt;code&gt;Start-Process msiexec.exe -ArgumentList '/i C:\az.msi /quiet /norestart' -Wait&lt;/code&gt;&lt;br&gt;`Get-Service vstsagent* \&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;{% raw %}&lt;code&gt;Get-ChildItem : Cannot find path '...\apps\'&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Repo files nested one folder deeper than the YAML expected&lt;/td&gt;
&lt;td&gt;Fix &lt;code&gt;sourceFolder&lt;/code&gt; and trigger &lt;code&gt;paths&lt;/code&gt; to include the prefix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ERROR: incorrect usage: --expiry should be within 7 days from now&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Identity-based (user-delegation) SAS is capped at &lt;strong&gt;7 days&lt;/strong&gt; — and a 7-day SAS would be a time bomb anyway, since the app re-reads the package URL on every restart&lt;/td&gt;
&lt;td&gt;Drop SAS entirely; switch to the MI-authenticated plain URL (this article's approach)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Pipeline green, but portal shows &lt;code&gt;Error retrieving workflows. Encountered an error (ServiceUnavailable) from host runtime&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;App couldn't pull the package: &lt;code&gt;WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID&lt;/code&gt; missing, &lt;strong&gt;and&lt;/strong&gt; the app's identity had no role on storage&lt;/td&gt;
&lt;td&gt;Add the app setting; grant &lt;code&gt;Storage Blob Data Reader&lt;/code&gt; to the app's identity; wait ~5 min for RBAC; restart&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  A 60-second diagnostic when the runtime won't start
&lt;/h3&gt;

&lt;p&gt;Run from any machine with &lt;code&gt;az&lt;/code&gt; — checks the four usual suspects at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$rg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"rg-logicapps-prod"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"la-integration-prod"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$st&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"stdeploypkgs"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$strg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"rg-storage"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$sub&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;sub-id&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# 1. Identity on?&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;az&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;webapp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;identity&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$rg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;principalId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;tsv&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# 2. Both settings present?&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;az&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;webapp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;appsettings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$rg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;--query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"[?starts_with(name,'WEBSITE_RUN_FROM')].{n:name,v:value}"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;table&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# 3. App identity has a role on storage?&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;az&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;assignment&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--assignee&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;principalId-from-step-1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;--scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/subscriptions/&lt;/span&gt;&lt;span class="nv"&gt;$sub&lt;/span&gt;&lt;span class="s2"&gt;/resourceGroups/&lt;/span&gt;&lt;span class="nv"&gt;$strg&lt;/span&gt;&lt;span class="s2"&gt;/providers/Microsoft.Storage/storageAccounts/&lt;/span&gt;&lt;span class="nv"&gt;$st&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;--query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"[].roleDefinitionName"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;tsv&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# 4. Storage reachable at all?&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;az&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;account&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$strg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$st&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;--query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{publicNetworkAccess:publicNetworkAccess, defaultAction:networkRuleSet.defaultAction}"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;table&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whichever check comes back empty is your culprit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this beats the alternatives
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SAS URL in &lt;code&gt;WEBSITE_RUN_FROM_PACKAGE&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Works, but user-delegation SAS caps at 7 days and account-key SAS means handling keys. Either way the app dies quietly when the token expires — on whatever future day it happens to restart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zip-deploy via VNet self-hosted agent&lt;/td&gt;
&lt;td&gt;The classic answer. Fine — but it makes deployment hostage to one VM's health, and you still shouldn't need SCM for a package-based app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MI-authenticated Run-From-Package&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No secrets, no expiry, no SCM, works from any agent that can reach ARM + Storage. The package is also immutable per build ID, so rollback = point the setting at the previous zip and restart&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Hardening checklist for after the pilot
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Approval gate on the ADO Environment before the Deploy stage.&lt;/li&gt;
&lt;li&gt;Private endpoint on the storage account once the pattern is proven (the app pulls over the VNet; the pipeline needs its own route — service endpoint or an agent with access).&lt;/li&gt;
&lt;li&gt;Lifecycle policy on the container — build-numbered zips accumulate forever otherwise.&lt;/li&gt;
&lt;li&gt;Keep the inline-secret linter. It costs nothing and blocks the exact class of mistake that infests legacy workflow definitions.&lt;/li&gt;
&lt;li&gt;New workflows that replace still-running legacy ones should ship &lt;strong&gt;disabled&lt;/strong&gt; and be enabled at cutover — never let two schedulers fire the same job.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Total elapsed time for us, including all six failures: one working session. Total time if you follow this article: about 30 minutes — 25 of which are waiting for an MSI installer and RBAC propagation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>logicapps</category>
      <category>azure</category>
    </item>
    <item>
      <title># CSPM, CWPP, CIEM, CNAPP, EASM: Decoding the Cloud Security Alphabet</title>
      <dc:creator>Vignesh Athiappan</dc:creator>
      <pubDate>Sat, 22 Aug 2026 04:30:21 +0000</pubDate>
      <link>https://dev.to/vicky_acedia/-cspm-cwpp-ciem-cnapp-easm-decoding-the-cloud-security-alphabet-2849</link>
      <guid>https://dev.to/vicky_acedia/-cspm-cwpp-ciem-cnapp-easm-decoding-the-cloud-security-alphabet-2849</guid>
      <description>&lt;p&gt;&lt;em&gt;Part 4 of 4 in the "Security Testing Landscape" series&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The cloud security market has produced some of the worst acronyms in IT history. Here's the secret that makes them all click: &lt;strong&gt;these aren't tests — they're continuous monitoring platforms, and each one watches a different layer of your cloud.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The analogy that makes it permanent: &lt;strong&gt;your cloud is a house.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CSPM — Cloud Security Posture Management
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Are the doors and windows locked?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CSPM watches your cloud &lt;strong&gt;configuration&lt;/strong&gt;: public storage accounts, wide-open network security groups, disabled encryption, subscriptions without MFA. It continuously scans against benchmarks (CIS, well-architected frameworks) and flags drift the moment someone loosens a setting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answers:&lt;/strong&gt; "Is my cloud set up wrong?"&lt;br&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; Microsoft Defender for Cloud, Wiz, Prisma Cloud, Orca&lt;/p&gt;

&lt;h2&gt;
  
  
  CWPP — Cloud Workload Protection Platform
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Is there an intruder inside a room?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CWPP watches the &lt;strong&gt;workloads themselves&lt;/strong&gt; — VMs, containers, serverless functions: vulnerabilities inside them, malware, suspicious runtime behavior, file integrity changes. Think of it as EDR, but for cloud compute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answers:&lt;/strong&gt; "Is something bad running inside my machines?"&lt;br&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; Defender for Servers/Containers, CrowdStrike Falcon Cloud Security, Aqua, SentinelOne&lt;/p&gt;

&lt;h2&gt;
  
  
  CIEM — Cloud Infrastructure Entitlement Management
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Who has too many keys?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CIEM watches &lt;strong&gt;identities and permissions&lt;/strong&gt;: which users, service principals, and managed identities can do what. It hunts over-permissioned accounts, roles nobody has used in months, and toxic combinations like "this identity can read the secrets vault &lt;em&gt;and&lt;/em&gt; is reachable from the internet."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answers:&lt;/strong&gt; "Who can do too much?"&lt;br&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; Microsoft Entra Permissions Management, Wiz, Sonrai, Tenable (Ermetic)&lt;/p&gt;

&lt;h2&gt;
  
  
  CNAPP — Cloud-Native Application Protection Platform
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;The whole smart-home security system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here's the trick: CNAPP is &lt;strong&gt;not a new capability&lt;/strong&gt;. It's the umbrella that bundles CSPM + CWPP + CIEM (plus IaC scanning and container scanning) into one platform with one dashboard. Its real power is &lt;strong&gt;chaining findings into attack paths&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;vulnerable container &lt;strong&gt;+&lt;/strong&gt; public exposure &lt;strong&gt;+&lt;/strong&gt; admin identity &lt;strong&gt;=&lt;/strong&gt; critical attack path, fix this first&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That prioritization — attack paths instead of ten thousand isolated alerts — is why the entire market converged on CNAPP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answers:&lt;/strong&gt; "Show me the actual attack paths across everything."&lt;br&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; Wiz, Prisma Cloud, Orca, Defender for Cloud (full plans) — the same vendors, selling the full suite&lt;/p&gt;

&lt;h2&gt;
  
  
  EASM — External Attack Surface Management
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Walking around the street outside, checking what a burglar sees.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;EASM flips the camera: it scans your organization &lt;strong&gt;from the public internet&lt;/strong&gt;, like an attacker with a browser and patience. It routinely finds assets you forgot existed — abandoned subdomains, exposed test APIs, expired certificates, shadow IT spun up by a team three years ago.&lt;/p&gt;

&lt;p&gt;The uncomfortable, recurring outcome: EASM discovers things that aren't in your asset inventory at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answers:&lt;/strong&gt; "What can the internet see of mine?"&lt;br&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; Microsoft Defender EASM, Censys, Palo Alto Cortex Xpanse — and Shodan for the manual version&lt;/p&gt;

&lt;h2&gt;
  
  
  The House, One Last Time
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Acronym&lt;/th&gt;
&lt;th&gt;Watches&lt;/th&gt;
&lt;th&gt;House analogy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CSPM&lt;/td&gt;
&lt;td&gt;Settings/config&lt;/td&gt;
&lt;td&gt;Doors and windows locked?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CWPP&lt;/td&gt;
&lt;td&gt;Workloads&lt;/td&gt;
&lt;td&gt;Intruder inside a room?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CIEM&lt;/td&gt;
&lt;td&gt;Identities/permissions&lt;/td&gt;
&lt;td&gt;Who has too many keys?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNAPP&lt;/td&gt;
&lt;td&gt;All of the above&lt;/td&gt;
&lt;td&gt;The full smart-home system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EASM&lt;/td&gt;
&lt;td&gt;The outside view&lt;/td&gt;
&lt;td&gt;What the burglar sees from the street&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One final classification note: CSPM, CWPP, CIEM, and CNAPP are all &lt;strong&gt;white box&lt;/strong&gt; — they read your subscriptions with granted access. &lt;strong&gt;EASM is the lone black box&lt;/strong&gt; of the group, and that outsider's perspective is exactly what makes it valuable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Series Wrap-Up
&lt;/h2&gt;

&lt;p&gt;Across four posts, the entire landscape reduces to four questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Is my application code safe?&lt;/strong&gt; → App Security Testing (SAST, DAST, SCA…)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can someone actually break in?&lt;/strong&gt; → Offensive assessments (VAPT, red teams, bug bounties)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Are we designing, building, and proving it right?&lt;/strong&gt; → Reviews and audits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is my cloud continuously watched?&lt;/strong&gt; → CSPM/CNAPP family&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Master which question each acronym answers, and you'll never nod along blankly in a security meeting again.&lt;/p&gt;

</description>
      <category>security</category>
    </item>
  </channel>
</rss>
