Repository navigation
ci(docs): migrate SWA docs deployment to Azure DevOps WIF pipeline - #66
Closed
Krrish Mittal (takyyon) wants to merge 7 commits into
Closed
Krrish Mittal (takyyon) wants to merge 7 commits into
Krrish Mittal (takyyon) wants to merge 7 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…lockdown - Enable main CI trigger on .azure-pipelines/docs-site-deploy.yml for Canary auto-deploy - Update docs-site/scripts/apply-lockdown.mjs prod frontDoorId to auto-portal-afd (fd12a176-4667-4e79-8d3d-0bd88e863ff7) - Keep credential-free PR/main Build validation in .github/workflows/docs-site-deploy.yml and remove mitigated Azure OIDC deploy jobs - Update docs-site/INFRA.md and docs-site/README.md for ADO pipeline 490778 and isolated WIF auth Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ct AFD host - Install pinned @azure/static-web-apps-cli@2.1.0 in a credential-free step before AzureCLI@2 so no npm install executes while WIF or SWA_CLI_DEPLOYMENT_TOKEN is in scope - Assert exact allowedForwardedHosts match against targetPublicHost in lockdown verification - Document zero-downtime Prod Standard SKU bootstrap/rollback, release tag hygiene, and LogicApps npm mirror requirements in docs-site/INFRA.md Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
Author
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:
631a69817c05ffad1bdb1538e6752d8d6c6c187c193213209(canary-20261125.3) succeeded end-to-end on this exact commit (SDLSources, credential-free Astro build + Python link validation underCFSClean, pinned SWA CLI pre-install, WIF deploy tootto-docs-canary-swa, and post-deploy smoke probeshttps://otto-canary.azure.com/docs/HTTP 200 + direct origin HTTP 403).↑ Negative security test
193210046(target=prodfrom feature branch) confirmed ADO Branch Control (1108237) blocksotto-docs-prod-armbefore any deploy agent starts.↓ Production deployment on
mainand the one-time zero-downtimeotto-docs-swaFree → Standard SKU cutover execute post-merge; PR GitHub ActionsBuildcheck runs upon PR creation.Summary
Migrates Azure Static Web Apps deployment for
docs-site/from the mitigated GitHub Actions OIDC identity (e8323013-aff3-46b9-8f7e-96ea41edf48a) to an Azure DevOps 1ES Official pipeline (Logic-Apps-Automation-Docs, definition490778inmsazure/One) backed by isolated Workload Identity Federation (WIF) service connections. Keeps fast, credential-free build and link validation in GitHub Actions for PRs andmain.Also updates
docs-site/scripts/apply-lockdown.mjsanddocs-site/INFRA.mdfor production to use the activeauto-portal-afdFront Door ID (fd12a176-4667-4e79-8d3d-0bd88e863ff7) instead of the legacyotto-portal-afdID (c1504f11-9bfe-40e3-b58f-923f88dc0689).Architecture & Design
.github/workflows/docs-site-deploy.ymlretains theBuildjob (npm ci,npm run check,npm run build, Python link checker unit tests, andscripts/validate_docs_site.py) withcontents: readonly. All Azure OIDC deploy and preview teardown jobs are removed.490778):.azure-pipelines/docs-site-deploy.ymlextendsv1/1ES.Official.PipelineTemplate.yml@1esPipelineswith two isolated stages:Build(credential-free,CFSCleannetwork isolation): authenticates.azure-pipelines/ado.npmrcto theLogicAppsAzure Artifacts npm mirror vianpmAuthenticate@0, rewrites lockfile registry URLs in the ephemeral workspace while preservingpackage-lock.jsonintegrity hashes, runsnpm ci,npm run check,npm run build, and Python link validation, and publishesdocs-dist.Deploy(canarydefault onmainpush;prodmanual-only): verifies target branch guard, injectsforwardingGatewayviadocs-site/scripts/apply-lockdown.mjs, asserts exactX-Azure-FDIDandallowedForwardedHosts, pre-installs pinned@azure/static-web-apps-cli@2.1.0before Azure login, authenticates via WIF (AzureCLI@2), enforcesStandardSKU, fetches the SWA deployment token just-in-time (masked with##vso[task.setsecret]), deploys with--swa-config-locationpinned to the locked-down staging directory, and runs post-deploy smoke probes (public AFD HTTP200, direct*.azurestaticapps.netorigin HTTP403).otto-docs-canary-arm→ UAMIotto-docs-canary-deploy-mi→Contributorscoped strictly tootto-docs-canary-swa+ pipeline490778only + Exclusive Lock.otto-docs-prod-arm→ UAMIotto-docs-prod-deploy-mi→Contributorscoped strictly tootto-docs-swa+ pipeline490778only + Exclusive Lock + Branch Control (refs/heads/main,refs/tags/release) + Manual Approval.Key Decisions
.github/workflows/docs-site-deploy.ymlwith theBuildjob name: Preserves fast PR feedback and avoids breaking any branch protection checks tied to theBuildjob while eliminating all Azure credentials from GitHub Actions.@azure/static-web-apps-cli@2.1.0outsideAzureCLI@2: Ensures zero npm package resolution executes while WIF credentials orSWA_CLI_DEPLOYMENT_TOKENare in scope.frontDoorIdtofd12a176-4667-4e79-8d3d-0bd88e863ff7(auto-portal-afd):auto.azure.comis fronted byauto-portal-afd(not legacyotto-portal-afd). Updating the FDID prevents HTTP403s onceotto-docs-swaruns onStandardSKU.Files Changed
.azure-pipelines/docs-site-deploy.yml— Added 1ES Official docs build, AFD lockdown, WIF SWA deploy, and post-deploy smoke-probe pipeline..azure-pipelines/ado.npmrc— Added internalLogicAppsAzure Artifacts npm upstream registry config for 1ESCFSCleanbuilds..github/workflows/docs-site-deploy.yml— Retained credential-freeBuildjob; removed mitigated Azure OIDC deploy and preview-close jobs.docs-site/scripts/apply-lockdown.mjs— UpdatedTARGETS.prod.frontDoorIdtofd12a176-4667-4e79-8d3d-0bd88e863ff7(auto-portal-afd).docs-site/INFRA.md— Updated resource map, ADO WIF architecture, zero-downtime Prod Standard SKU bootstrap/rollback runbook, and disaster-recovery commands.docs-site/README.md— Updated workflow references to point PR validation to GitHub Actions and Canary/Prod deploys to ADO pipeline490778.Testing
490778/preview): Expanded cleanly on final branch head.193213209,canary-20261125.3): Full green across🔒 SDLSources,Build and validate docs site, andDeploy docs site (canary)(https://otto-canary.azure.com/docs/→ HTTP200,https://lemon-mud-0e10bdd1e.7.azurestaticapps.net/docs/→ HTTP403).193210046,prod-20261125.1): Confirmed ADO Branch Control (1108237) rejectedtarget=prodfrom a non-mainbranch before any deploy agent started.apply-lockdown.mjsinjects expectedX-Azure-FDIDandallowedForwardedHostsfor bothcanaryandprod; validated YAML syntax for both workflow/pipeline files.Post-Merge Cutover Checklist
490778default branch tomainand add Branch Control (refs/heads/main,refs/tags/release) tootto-docs-canary-arm.docs-site/INFRA.md(deploy updatedfd12a176-4667-4e79-8d3d-0bd88e863ff7config whileotto-docs-swaisFree→az staticwebapp update --sku Standard→ run approved ADO490778target=proddeploy onmainand confirmhttps://auto.azure.com/docs/returns200and direct origin returns403).