Repository navigation
ci(docs): migrate SWA docs deployment to Azure DevOps WIF pipeline - #67
Merged
Merged
Conversation
- Add 1ES Official Azure DevOps pipeline (.azure-pipelines/docs-site-deploy.yml) and Azure Artifacts npmrc (.azure-pipelines/ado.npmrc) for Canary and Production SWA deploys via isolated WIF service connections, pinned SWA CLI pre-install, AFD lockdown verification, tag-ref & branch guards, and post-deploy smoke probes. - Narrow .github/workflows/docs-site-deploy.yml to credential-free PR and main build/link validation. - Update docs-site/scripts/apply-lockdown.mjs, docs-site/INFRA.md, and docs-site/README.md for the ADO WIF pipeline and Standard SKU AFD lockdown. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Brian Lam (lambrianmsft)
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
a9a05fbdeaf86704478a975cf55f19c9c8423d26npm run check47/47 blog tests +astro check0 errors,npm run build42 pages,unittest14/14,validate_docs_site.py42 pages / 3,036 links,apply-lockdown.mjscanary & prod config verification, tag-ref/branch guard checks).↑ All PR checks on
a9a05fbdeaf86704478a975cf55f19c9c8423d26passed: GitHub ActionsBuild(31s),license/cla, and live Azure DevOps 1ES Official run193225708(canary-20261125.4) across🔒 SDLSources,Build and validate docs site, andDeploy docs site (canary)(including AFD200and direct origin403probes).↓ Live Production deployment cannot run until this PR merges to
mainandlogicapps-auto-docs-prodis upgraded fromFreetoStandardSKU.Summary
Migrates docs-site deployment (
canaryandprod) from the mitigated GitHub Actions Azure OIDC application to a 1ES Official Azure DevOps pipeline (msazure/Onedefinition490778) using isolated Azure Workload Identity Federation (WIF) service connections.GitHub Actions remains active solely as a credential-free
BuildPR/push check.Architecture & Design
.github/workflows/docs-site-deploy.yml): Retains only theBuildjob (npm ci,npm run check,npm run build, Python unit tests, andvalidate_docs_site.py). RemovesDeployCanary,DeployProd,Preview, andClosePreviewjobs along with all Azure OIDC login andid-token: writepermissions..azure-pipelines/docs-site-deploy.yml):Build, credential-free): Builds Astro + Pagefind viaNpmAuthenticate@0against theLogicAppsAzure Artifacts npm upstream mirror (.azure-pipelines/ado.npmrc), runs blog tests,astro check, Python unit tests, andvalidate_docs_site.py, and publishesdocs-dist.Deploy, target-isolated WIF):refs/tags/*for all targets and restrictsprodstrictly torefs/heads/main.docs-distto a staged temp directory, applies target-specific Azure Front Door lockdown (apply-lockdown.mjs), and asserts the exact expectedX-Azure-FDIDandallowedForwardedHostsvalues before deployment.@azure/static-web-apps-cli@2.1.0in a separate credential-free step before enteringAzureCLI@2.StandardSKU, retrieves the deployment token via WIF (marked secret via##vso[task.setsecret]and passed viaSWA_CLI_DEPLOYMENT_TOKEN), and deploys viaswa deploy --swa-config-location.200and direct origin returns HTTP403.docs-site/scripts/apply-lockdown.mjs): Updates theprodfrontDoorIdto match the activeauto-portal-afdFront Door profile (fd12a176-4667-4e79-8d3d-0bd88e863ff7).docs-site/INFRA.md,docs-site/README.md): Documents ADO pipeline490778, WIF service connections,LogicAppsnpm mirror authentication, pinned SWA CLI pre-install, tag-ref/branch guards, and the zero-downtime ProdStandardSKU bootstrap and rollback runbook.Key Decisions
@azure/static-web-apps-cli@2.1.0outsideAzureCLI@2prevents third-party npm install lifecycle scripts from executing while Azure deployment credentials are in scope.Standardor ifstaticwebapp.config.jsondoes not contain the exact expectedX-Azure-FDIDand host prevents accidentally publishing an unlocked site or breaking AFD header enforcement.main, Prod remains manual: Merges tomainautomatically validate and deploy Canary (otto-canary.azure.com), while Production (auto.azure.com) requires an explicit manual pipeline run onrefs/heads/mainwithdeployTarget=prod.Files Changed
.azure-pipelines/docs-site-deploy.yml— New 1ES Official docs build and WIF deploy pipeline..azure-pipelines/ado.npmrc— Azure ArtifactsLogicAppsnpm upstream registry config forCFSCleanpool builds..github/workflows/docs-site-deploy.yml— Simplified to credential-freeBuildjob only.docs-site/scripts/apply-lockdown.mjs— UpdatedprodfrontDoorIdto activeauto-portal-afd.docs-site/INFRA.md— Updated infrastructure, WIF pipeline architecture, and Prod cutover/rollback docs.docs-site/README.md— Updated deployment overview to reference ADO pipeline490778.Testing
a9a05fbdeaf86704478a975cf55f19c9c8423d26:.azure-pipelines/docs-site-deploy.yml,.github/workflows/docs-site-deploy.yml) — passed.npm ci+npm run check— 47/47 blog tests passed;astro check0 errors, 0 warnings, 0 hints.npm run build— 42 pages + Pagefind + postbuild succeeded.python3 -m unittest discover -s scripts/tests -p 'test_*.py'— 14/14 passed.python3 scripts/validate_docs_site.py— passed (42 pages, 3,036 links).apply-lockdown.mjsverified for bothcanary(2ca9cd4d-6df1-47b7-b8e2-24ba2bd17727/otto-canary.azure.com) andprod(fd12a176-4667-4e79-8d3d-0bd88e863ff7/auto.azure.com).refs/tags/*) andprod-on-non-mainbranch guard shell logic verified.Buildcheck ona9a05fbdeaf86704478a975cf55f19c9c8423d26—pass(31s).license/cla—pass.193225708(canary-20261125.4) onrefs/heads/feature/ado-docs-deploy-pipeline(a9a05fbdeaf86704478a975cf55f19c9c8423d26) —succeededacross🔒 SDLSources,Build and validate docs site, andDeploy docs site (canary), including post-deploy AFD200and direct origin403probes.Post-Merge Cutover
490778default branch fromkrmitta/ado-docs-deploy-pipelinetomain, then delete the temporarykrmitta/ado-docs-deploy-pipelinebranch.mainCI Canary run succeeds on490778.prodrun, upgradelogicapps-auto-docs-prodfromFreetoStandardSKU and run490778manually onmainwithdeployTarget=prod(seedocs-site/INFRA.md).