πŸ”’ Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided AZ-400 Domain 3
Domain 3 β€” Module 5 of 13 38%
11 of 25 overall

AZ-400 Study Guide

Domain 1: Design and Implement Processes and Communications

  • Work Item Tracking: Boards, GitHub & Flow
  • DevOps Metrics: Dashboards That Drive Decisions
  • Collaboration: Wikis, Teams & Release Notes

Domain 2: Design and Implement a Source Control Strategy

  • Branching Strategies: Trunk-Based, Feature & Release
  • Pull Requests: Policies, Protections & Merge Rules
  • Repository Management: LFS, Permissions & Recovery

Domain 3: Design and Implement Build and Release Pipelines

  • Package Management: Feeds, Versioning & Upstream
  • Testing Strategy: Quality Gates & Release Gates
  • Test Implementation: Code Coverage & Pipeline Tests
  • Azure Pipelines: YAML from Scratch Free
  • GitHub Actions: Workflows from Scratch Free
  • Pipeline Agents: Self-Hosted, Hybrid & VM Templates
  • Multi-Stage Pipelines: Templates, Variables & Approvals
  • Deployment Strategies: Blue-Green, Canary & Ring Free
  • Safe Rollouts: Slots, Dependencies & Hotfix Paths
  • Deployment Implementations: Containers, Scripts & Databases
  • Infrastructure as Code: ARM vs Bicep vs Terraform
  • IaC in Practice: Desired State & Deployment Environments
  • Pipeline Maintenance: Health, Migration & Retention

Domain 4: Develop a Security and Compliance Plan

  • Pipeline Identity: Service Principals, Managed IDs & OIDC Free
  • Authorization & Access: GitHub Roles & Azure DevOps Security
  • Secrets & Secure Pipelines: Key Vault & Workload Federation
  • Security Scanning: GHAS, Defender & Dependabot

Domain 5: Implement an Instrumentation Strategy

  • Monitoring for DevOps: Azure Monitor & App Insights
  • Metrics & KQL: Analysing Telemetry & Traces

AZ-400 Study Guide

Domain 1: Design and Implement Processes and Communications

  • Work Item Tracking: Boards, GitHub & Flow
  • DevOps Metrics: Dashboards That Drive Decisions
  • Collaboration: Wikis, Teams & Release Notes

Domain 2: Design and Implement a Source Control Strategy

  • Branching Strategies: Trunk-Based, Feature & Release
  • Pull Requests: Policies, Protections & Merge Rules
  • Repository Management: LFS, Permissions & Recovery

Domain 3: Design and Implement Build and Release Pipelines

  • Package Management: Feeds, Versioning & Upstream
  • Testing Strategy: Quality Gates & Release Gates
  • Test Implementation: Code Coverage & Pipeline Tests
  • Azure Pipelines: YAML from Scratch Free
  • GitHub Actions: Workflows from Scratch Free
  • Pipeline Agents: Self-Hosted, Hybrid & VM Templates
  • Multi-Stage Pipelines: Templates, Variables & Approvals
  • Deployment Strategies: Blue-Green, Canary & Ring Free
  • Safe Rollouts: Slots, Dependencies & Hotfix Paths
  • Deployment Implementations: Containers, Scripts & Databases
  • Infrastructure as Code: ARM vs Bicep vs Terraform
  • IaC in Practice: Desired State & Deployment Environments
  • Pipeline Maintenance: Health, Migration & Retention

Domain 4: Develop a Security and Compliance Plan

  • Pipeline Identity: Service Principals, Managed IDs & OIDC Free
  • Authorization & Access: GitHub Roles & Azure DevOps Security
  • Secrets & Secure Pipelines: Key Vault & Workload Federation
  • Security Scanning: GHAS, Defender & Dependabot

Domain 5: Implement an Instrumentation Strategy

  • Monitoring for DevOps: Azure Monitor & App Insights
  • Metrics & KQL: Analysing Telemetry & Traces
Domain 3: Design and Implement Build and Release Pipelines Free ⏱ ~15 min read

GitHub Actions: Workflows from Scratch

Master GitHub Actions workflow syntax β€” events, jobs, runners, steps, and reusable workflows. Build CI/CD pipelines that run on every push, pull request, or schedule.

What is GitHub Actions?

β˜• Simple explanation

Think of a smart home automation system.

You set rules: β€œWhen the front door opens (event), turn on the hallway lights (job 1) AND start the security camera (job 2).” Each rule has a trigger (the event) and one or more actions that happen in response. Some actions happen in parallel (lights + camera), others happen in sequence (unlock door, then disarm alarm).

GitHub Actions works the same way for your code repository. You define rules: β€œWhen someone pushes code (event), run the build (job 1) AND run the tests (job 2).” Workflows live in YAML files inside your repository, and GitHub’s cloud runners execute them automatically.

GitHub Actions is GitHub’s built-in CI/CD and automation platform. Workflows are defined in YAML files stored in .github/workflows/ and execute on runners β€” either GitHub-hosted virtual machines or self-hosted machines you manage.

The platform supports over 50 event types (push, pull_request, schedule, issue creation, manual dispatch, and more), giving you far more automation triggers than just code changes. Combined with the GitHub Marketplace (over 20,000 community-contributed actions), it provides a composable automation system for any software development workflow.

The AZ-400 exam expects you to know GitHub Actions syntax, events, job parallelism, matrix strategies, environments with protection rules, and how it compares to Azure Pipelines.

The workflow hierarchy

Workflow (.github/workflows/*.yml)
  └── Jobs (run in parallel by default)
       └── Steps (run sequentially)
LevelWhat It RepresentsKey Property
WorkflowThe entire automation definitionon: β€” which events trigger it
JobA unit of work on one runnerruns-on: β€” which runner executes it
StepA single action or commanduses: (action) or run: (script)

Key difference from Azure Pipelines: GitHub Actions has no β€œstage” level. Jobs ARE the top-level unit under a workflow. You create stage-like behaviour by grouping jobs with needs: dependencies.

Events β€” when workflows run

GitHub Actions supports 50+ event types. The exam focuses on the most common:

Code events

EventFires WhenCommon Use
pushCode is pushed to a branchCI builds, deployments on merge to main
pull_requestPR is opened, updated (synchronize), reopened, or closedPR validation, code review automation
pull_request_targetSame as pull_request but runs in the BASE branch contextSafe automation on PRs from forks (avoids secret leakage)

Scheduled events

on:
  schedule:
    - cron: '30 5 * * 1-5'

Runs on a UTC cron schedule. Note: GitHub Actions cron can be delayed during high-demand periods β€” don’t rely on precise timing for time-critical workflows.

Manual and API events

EventFires WhenUse Case
workflow_dispatchManually triggered from the UI or REST APIAd-hoc deployments, manual test runs
repository_dispatchExternal system sends a webhookCross-repo triggers, external CI integration

Event filtering

Events support filtering by branch, path, tag, and activity type:

on:
  push:
    branches:
      - main
      - 'release/**'
    paths:
      - 'src/**'
    tags:
      - 'v*'
  pull_request:
    branches:
      - main
    types:
      - opened
      - synchronize

The types: filter is unique to GitHub Actions β€” you can react to specific PR activities (opened, closed, labeled, review_requested) rather than all PR events.

πŸ’‘ Exam tip: pull_request vs pull_request_target

This is a high-value exam topic:

  • pull_request runs the workflow from the HEAD branch (the PR’s source code). Secrets from the base repo are NOT available to PRs from forks β€” this prevents secret theft.
  • pull_request_target runs the workflow from the BASE branch (the target branch). Secrets ARE available, but the code being tested is from the BASE, not the PR. Use this for safe label-based automation on fork PRs.

Security rule: Never use pull_request_target with actions/checkout pointing at the PR head AND passing secrets β€” this allows a fork PR to inject malicious code that runs with your secrets.

Jobs β€” parallel by default

Jobs within a workflow run in parallel unless you add needs: to create dependencies:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test

  deploy:
    runs-on: ubuntu-latest
    needs: [build, test]
    steps:
      - run: echo "Deploying after build and test succeed"

In this example, build and test run in parallel. deploy waits for both to finish. This is β€œfan-out / fan-in” execution.

Matrix strategy

A matrix lets you run the same job across multiple configurations (OS, language version, Node version) in parallel:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        node: [18, 20, 22]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci && npm test

This creates 9 parallel jobs (3 OS times 3 Node versions). Matrix is powerful for testing cross-platform compatibility.

Key matrix options:

  • fail-fast: false β€” continue all matrix jobs even if one fails (default is true β€” cancel all on first failure)
  • max-parallel: 2 β€” limit how many matrix jobs run simultaneously
  • include: / exclude: β€” add or remove specific combinations

Steps: actions vs run

Steps execute sequentially within a job:

Actions (uses:)

- uses: actions/checkout@v4
- uses: actions/setup-node@v4
  with:
    node-version: '20'

Actions are reusable units from the GitHub Marketplace or your own repositories. The @v4 pins the major version.

Scripts (run:)

- run: npm ci && npm test
  env:
    NODE_ENV: test

Shell commands executed on the runner. Use shell: bash or shell: pwsh to specify the shell explicitly.

Key built-in actions

ActionPurpose
actions/checkout@v4Check out repository code onto the runner
actions/setup-node@v4Install a specific Node.js version
actions/setup-dotnet@v4Install a specific .NET SDK version
actions/setup-java@v4Install a specific JDK version
actions/setup-python@v5Install a specific Python version
actions/cache@v4Cache dependencies (node_modules, .nuget) between runs
actions/upload-artifact@v4Upload build artefacts for later jobs or downloads
actions/download-artifact@v4Download artefacts from previous jobs

Environments with protection rules

GitHub Actions environments provide deployment targets with governance:

jobs:
  deploy-staging:
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - run: echo "Deploy to staging"

  deploy-production:
    runs-on: ubuntu-latest
    needs: deploy-staging
    environment: production
    steps:
      - run: echo "Deploy to production"

Environment protection rules:

  • Required reviewers β€” pause the workflow until specified people approve
  • Wait timer β€” delay deployment by N minutes (cool-down period)
  • Deployment branches β€” restrict which branches can deploy (e.g., only main to production)
  • Custom protection rules β€” call external APIs for approval decisions

Environments also store secrets and variables scoped to that environment β€” production secrets are only available to jobs targeting the production environment.

Azure Pipelines vs GitHub Actions β€” side by side

Both platforms support YAML CI/CD β€” Azure Pipelines has stages and richer templates; GitHub Actions has a larger marketplace and more event types
ConceptAzure PipelinesGitHub Actions
Definition fileazure-pipelines.yml (root of repo).github/workflows/*.yml (multiple files supported)
HierarchyPipeline > Stages > Jobs > StepsWorkflow > Jobs > Steps (no stage concept)
CI triggertrigger: keyword with branch/path filterson: push with branch/path/tag filters
PR triggerpr: keyword (Azure Repos) or branch policies (GitHub)on: pull_request with branch/type filters
Scheduled triggerschedules: with cron and branch filterson: schedule with cron expression
Manual triggerPipeline can always be queued manually, or use trigger: noneon: workflow_dispatch with optional input parameters
Job parallelismJobs within a stage run in parallel by defaultJobs within a workflow run in parallel by default
DependenciesdependsOn: keyword at stage or job levelneeds: keyword at job level
Matrixstrategy: matrix on jobsstrategy: matrix on jobs (similar syntax)
Reusable templatesYAML templates (extends, include) for stages, jobs, stepsReusable workflows (workflow_call), composite actions
Environmentsenvironment: keyword on deployment jobs, with checks and approvalsenvironment: keyword on jobs, with protection rules (reviewers, timers, branch restrictions)
MarketplaceAzure DevOps Marketplace (tasks and extensions)GitHub Marketplace (20,000+ actions)
πŸ’‘ Scenario: Kai builds the Launchpad Labs CI workflow

πŸš€ Kai Tanaka at Launchpad Labs sets up CI for their Next.js SaaS app. The team is GitHub-first, so Actions is the natural choice.

The workflow:

  1. Trigger β€” on: push to main and on: pull_request to main
  2. Matrix β€” test on Node 20 and 22, on Ubuntu and Windows (4 combinations)
  3. Steps β€” checkout, setup-node with caching, npm ci, lint, test with coverage, build
  4. Artefact upload β€” the build output is uploaded with actions/upload-artifact
  5. Deploy job β€” needs: [test], targets the staging environment with required reviewer (Sam, CTO), deploys to Kubernetes

Riku (frontend) asks: β€œWhy does the matrix run 4 jobs? We only deploy on Ubuntu.” Kai explains: β€œThe matrix validates cross-platform compatibility. The deploy job runs once, after all matrix jobs pass β€” needs: creates the dependency.”

Zoe (QA) adds a comment: β€œCan I run E2E tests only on PRs to main?” Kai adds a separate job with if: github.event_name == 'pull_request' to conditionally run Playwright tests.

Question

What is the GitHub Actions YAML hierarchy?

Click or press Enter to reveal answer

Answer

Workflow contains Jobs. Jobs contain Steps. There is no 'stage' concept β€” jobs are the top-level unit. Jobs run in parallel by default; use 'needs:' for sequential dependencies. Steps within a job run sequentially. Workflows are stored in .github/workflows/ directory.

Click to flip back

Question

What is the difference between 'pull_request' and 'pull_request_target' events?

Click or press Enter to reveal answer

Answer

pull_request runs the workflow code from the PR's HEAD branch. Secrets are not available on fork PRs (security). pull_request_target runs the workflow code from the BASE branch (target). Secrets are available. Use pull_request_target for safe automation on fork PRs β€” but never checkout the PR head code when secrets are in scope.

Click to flip back

Question

What does 'fail-fast: false' do in a GitHub Actions matrix strategy?

Click or press Enter to reveal answer

Answer

By default (fail-fast: true), if any matrix job fails, all other running matrix jobs are cancelled. Setting fail-fast: false lets all matrix jobs complete even if one fails. Use this when you want to see the full picture of which platform/version combinations pass and which fail.

Click to flip back

Question

What are GitHub Actions environment protection rules?

Click or press Enter to reveal answer

Answer

Rules that govern deployments to an environment: 1) Required reviewers β€” human approval before deployment. 2) Wait timer β€” delay by N minutes. 3) Deployment branch rules β€” restrict which branches can deploy. 4) Custom protection rules β€” external API approval. Environments also scope secrets and variables.

Click to flip back

Question

How does workflow_dispatch differ from repository_dispatch in GitHub Actions?

Click or press Enter to reveal answer

Answer

workflow_dispatch allows manual triggering from the GitHub UI or REST API β€” you can define input parameters users fill in. repository_dispatch is triggered by external systems sending a webhook event to the GitHub API. Use workflow_dispatch for human-initiated runs; repository_dispatch for cross-repo or external system triggers.

Click to flip back

Knowledge check

Knowledge Check

Kai defines a workflow with three jobs: lint, test, and deploy. Lint and test have no 'needs:' keyword. Deploy has 'needs: [lint, test]'. What is the execution order?

Knowledge Check

A workflow uses on: pull_request to run CI checks. An external contributor forks the repo and opens a PR. The workflow needs a secret (API_KEY) to run integration tests. What happens?

Knowledge Check

Nadia wants to migrate a three-stage Azure Pipeline (Build > Test > Deploy) to GitHub Actions. Azure Pipelines has stages β€” GitHub Actions does not. How should she model the three stages?

🎬 Video coming soon

Next up: Pipeline Agents β€” choose between hosted and self-hosted agents, design agent infrastructure, and handle hybrid and air-gapped environments.

← Previous

Azure Pipelines: YAML from Scratch

Next β†’

Pipeline Agents: Self-Hosted, Hybrid & VM Templates

Guided

I learn, I simplify, I share.

A Guide to Cloud YouTube Feedback

© 2026 Sutheesh. All rights reserved.

Guided is an independent study resource and is not affiliated with, endorsed by, or officially connected to Microsoft. Microsoft, Azure, and related trademarks are property of Microsoft Corporation. Always verify information against Microsoft Learn.