📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

How do Azure DevOps Pipelines and GitHub Actions compare? Explain YAML pipelines, stages and jobs, environments and approvals in each, and how you would choose between them for a .NET team today.

Compares Azure DevOps Pipelines and GitHub Actions: YAML structure, stages and jobs, templates and reusable workflows, environments, approvals and checks, service connections and OIDC, and how to choose.

Intermediate Theory Intermediate approvals azure-devops ci-cd devops github-actions yaml-pipelines

🎯 Key points

  • Azure Pipelines has a real stage level (stages > jobs > steps) where conditions, approvals and checks apply; GitHub Actions has no stage concept, only jobs ordered with needs:
  • Azure DevOps checks attach to resources (environments, service connections, agent pools); GitHub protection attaches to environments
  • Reuse: Azure Pipelines templates and extends vs GitHub reusable workflows and composite actions
  • Azure service connections with workload identity federation vs GitHub OIDC with azure/login
  • Azure DevOps integrates tightly with Boards, Test Plans, Artifacts and Azure deployment tasks, which suits audit-heavy enterprises
  • Classic release pipelines are legacy; use YAML multi-stage pipelines
  • Both platforms are actively updated; GitHub usually gets developer-experience features first, Azure DevOps keeps enterprise and compliance features
  • Choose by where code, backlog and approval evidence already live

⏱ 30-second answer

Both run YAML pipelines as code. Azure Pipelines has a genuine stage level (stages → jobs → steps), and its environments and other resources carry approvals and checks (manual approval, branch control, business hours, exclusive lock, Azure Monitor gates), with templates for reuse. GitHub Actions has no stage concept: workflows → jobs → steps, chained with needs:, plus environments with required reviewers, wait timers and branch rules, and reusable workflows and composite actions.

Both authenticate to Azure without secrets: Azure DevOps through workload identity federation service connections, GitHub through OIDC with azure/login.

I choose mostly by where the code, backlog and audit evidence already live. Both are actively developed: GitHub tends to get developer-experience features first (Copilot, the marketplace), while Azure DevOps keeps strong enterprise traceability (Boards, Test Plans, resource checks) that many Australian enterprises and government teams depend on.

🗣 Full answer (senior)

How I would answer this in an interview

"Conceptually they're the same: a YAML file in the repo, triggered by pushes or PRs, running jobs on hosted or self-hosted agents. The vocabulary differs. Azure Pipelines has stages, which contain jobs, which contain steps; a deployment job targets an environment, and that environment is where you hang approvals and checks. GitHub Actions has workflows with jobs that you order with needs:; there's no stage keyword, so a 'stage' is just a job or group of jobs, and a job can reference an environment with required reviewers.

The differences show up in governance. Azure DevOps environments and service connections support a long list of checks: manual approvals, branch control so only main can use the production connection, business-hours windows, exclusive locks so deployments queue rather than overlap, and gates that query Azure Monitor. GitHub covers the common ones (required reviewers, wait timers, deployment branch rules, and concurrency for queuing), and custom deployment protection rules for the rest. For reuse, Azure has templates and extends templates that let a platform team force every pipeline through approved steps; GitHub has reusable workflows and composite actions, plus required workflows through rulesets.

The mistake I see is teams treating this as a technical decision when it's mostly an organisational one. If the code and backlog are already in Azure Repos and Boards, and auditors like the approval history there, migrating buys little. If the code is on GitHub, I'd use Actions rather than wiring Azure Pipelines to GitHub. For a new team I'd lean to GitHub because that's where Microsoft is putting most new features, but either is a sound choice."


Terminology map

Concept Azure Pipelines GitHub Actions
File azure-pipelines.yml .github/workflows/*.yml
Top level stages: jobs:
Ordering dependsOn: needs:
Deploy target deployment job + environment: job with environment:
Reuse templates, extends: reusable workflows (workflow_call), composite actions
Variables / secrets variable groups, library, Key Vault-linked groups repo/org/environment variables and secrets
Azure auth service connection (workload identity federation) azure/login with OIDC
Runners Microsoft-hosted / self-hosted agents, scale set agents GitHub-hosted / self-hosted runners, larger runners
Artefacts Pipeline artifacts, Azure Artifacts feeds workflow artefacts, GitHub Packages

Approvals and checks

Check Azure DevOps GitHub
Manual approval Yes (environment/resource) Required reviewers on environment
Branch restriction Branch control check Deployment branches/tags rule
Time window Business hours check Wait timer (delay only); custom rule for windows
No overlapping deploys Exclusive lock concurrency: group
Query monitoring Azure Monitor alerts / REST gate Custom deployment protection rule (GitHub App)
Enforced template extends + required template check Required workflows via rulesets

How I'd choose

Situation Choice
Code on GitHub, new team GitHub Actions
Azure Repos + Boards + test plans already embedded Stay on Azure DevOps
Heavy compliance needing richer built-in checks Azure DevOps, or GitHub with custom protection rules
Mixed estate Code where it is; avoid cross-wiring both systems per repo

Production example

A state government agency kept Azure DevOps because change approvals in Boards fed their ITIL process; production stages used a business-hours check and an exclusive lock, which cut overlapping deploy incidents to zero. A SaaS team on GitHub moved from Azure Pipelines to Actions and reduced their pipeline YAML from about 400 to 150 lines by using one reusable workflow across 12 services.

🔍 What the interviewer is checking

Checks whether the candidate knows both platforms' building blocks well enough to map one to the other, and chooses based on organisational context rather than preference.

Green flags

  • Maps stages/jobs/steps and templates vs reusable workflows correctly
  • Knows approvals and checks attach to environments and resources
  • Mentions secretless auth (workload identity federation / OIDC) in both
  • Gives a context-based choice and an honest view of Microsoft's direction

Red flags

  • Only knows one platform and dismisses the other
  • Recommends classic release pipelines for new work
  • Thinks the choice is purely about YAML syntax

📚 Learn in depth

1. Execution model

Azure Pipelines                              GitHub Actions

pipeline                                     workflow
 └─ stage: Build                              ├─ job: build
 │   └─ job: build                            │    └─ steps
 │        └─ steps                            ├─ job: deploy-test  (needs: build, environment: test)
 └─ stage: DeployProd (dependsOn: Build)      └─ job: deploy-prod  (needs: deploy-test, environment: production)
     └─ deployment job (environment: prod)
          └─ strategy: runOnce | rolling | canary

Azure deployment jobs have built-in strategies (runOnce, rolling, canary) with lifecycle hooks (preDeploy, deploy, routeTraffic, postRouteTraffic, on: failure). In GitHub you script the equivalent steps yourself.

2. Where approvals live

In Azure DevOps, checks attach to resources: environments, service connections, agent pools, variable groups, repos. A stage pauses when it first uses a protected resource. That means you can protect the production service connection itself, so even a badly written pipeline can't use it without approval.

In GitHub, protection attaches to environments; secrets and variables scoped to an environment are only available after its rules pass. Combine with OIDC subjects scoped to the environment for the same effect.

3. Secretless Azure access

Azure DevOps service connections using workload identity federation (generally available since 2024) work like GitHub OIDC: Azure DevOps issues a token whose subject identifies the organisation, project and service connection, and Entra trusts it through a federated credential. Existing secret-based connections can be converted in place.

4. Templates vs reusable workflows

  • Azure: template: includes steps/jobs/stages with typed parameters; extends: makes a pipeline inherit a template that can forbid arbitrary steps. A "required template" check on a resource enforces it.
  • GitHub: workflow_call reusable workflows (called as a job), composite actions (a bundle of steps), and organisation rulesets that can require a workflow to pass.

5. Direction of travel (as of late 2026)

Microsoft continues to support Azure DevOps and ships updates, but most new developer-platform features (Copilot integration, Advanced Security features first, the marketplace ecosystem) land in GitHub first. GitHub Advanced Security is also available for Azure DevOps. Classic (UI) release pipelines are legacy; new work should use YAML multi-stage pipelines.

6. Migration notes

  • GitHub Actions Importer can convert Azure Pipelines YAML to workflows as a starting point.
  • Map variable groups to environment secrets/variables, service connections to OIDC identities, and environment checks to environment rules.
  • Plan for features without a direct equivalent (business hours, Azure Monitor gates) as custom protection rules or scripted checks.

Try it yourself

  1. Write the same build-test-deploy pipeline in both systems for a minimal API and compare line counts.
  2. In Azure DevOps, add an approval and a branch control check to an environment and try to deploy from a feature branch.
  3. Convert a secret-based Azure Resource Manager service connection to workload identity federation.
  4. In GitHub, create a reusable workflow and call it from two repos with different inputs.
  5. Add concurrency: production to a GitHub job and trigger two runs to see the second one queue.

💻 Code

The same build-and-deploy shape in Azure Pipelines (azure-pipelines.yml):

trigger:
  branches: { include: [main] }

variables:
  buildConfiguration: Release

stages:
- stage: Build
  jobs:
  - job: build
    pool: { vmImage: ubuntu-latest }
    steps:
    - task: UseDotNet@2
      inputs: { useGlobalJson: true }
    - script: dotnet test -c $(buildConfiguration) --logger trx
      displayName: Build and test
    - task: PublishTestResults@2
      condition: always()
      inputs: { testResultsFormat: VSTest, testResultsFiles: '**/*.trx' }
    - script: dotnet publish src/Orders.Api -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/app
    - publish: $(Build.ArtifactStagingDirectory)/app
      artifact: app

- stage: DeployProd
  dependsOn: Build
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
  jobs:
  - deployment: deploy
    environment: orders-prod          # approvals, branch control, exclusive lock configured here
    pool: { vmImage: ubuntu-latest }
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureWebApp@1
            inputs:
              azureSubscription: sc-orders-prod-wif   # workload identity federation, no secret
              appName: app-orders-prod-aue
              deployToSlotOrASE: true
              resourceGroupName: rg-orders-prod-aue
              slotName: staging
              package: $(Pipeline.Workspace)/app

And the equivalent GitHub Actions job ordering:

jobs:
  build:
    uses: contoso/platform/.github/workflows/dotnet-build.yml@v3   # reusable workflow
  deploy-prod:
    needs: build
    environment: production       # required reviewers + deployment branch rule
    concurrency: production       # like an exclusive lock
    runs-on: ubuntu-latest
    permissions: { id-token: write }
    steps:
      - uses: azure/login@v2
        with:
          client-id: ${{ vars.AZURE_CLIENT_ID }}
          tenant-id: ${{ vars.AZURE_TENANT_ID }}
          subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
      - run: az webapp deploy -g rg-orders-prod-aue -n app-orders-prod-aue --slot staging --src-path app.zip

A tiny C# check both pipelines can run as a smoke test step (tools/SmokeTest/Program.cs):

using System.Net.Http;

var url = args.Length > 0 ? args[0] : throw new ArgumentException("Pass the base URL.");
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(10) };

for (var attempt = 1; attempt <= 10; attempt++)
{
    try
    {
        using var response = await http.GetAsync($"{url}/health/ready");
        if (response.IsSuccessStatusCode) { Console.WriteLine("Ready"); return 0; }
    }
    catch (HttpRequestException) { /* app still starting */ }
    await Task.Delay(TimeSpan.FromSeconds(6));
}
Console.Error.WriteLine("Smoke test failed");
return 1; // non-zero fails the pipeline step

⚠ Common mistakes

  • Mistake: Treating stages in Azure Pipelines and jobs in GitHub Actions as identical. Why it is wrong: Azure stages group jobs and carry conditions and approvals; GitHub has no stage keyword. Instead: Model stages as jobs (or reusable workflows) chained with needs:.
  • Mistake: Starting new work in classic release pipelines. Why it is wrong: They are not code-reviewed or versioned with the app and are legacy. Instead: Use YAML multi-stage pipelines.
  • Mistake: Putting approvals on the pipeline instead of the protected resource. Why it is wrong: Another pipeline could use the production connection unchecked. Instead: Add checks on the environment and service connection.
  • Mistake: Keeping secret-based service connections. Why it is wrong: Secrets expire and leak. Instead: Convert to workload identity federation (Azure DevOps) or OIDC (GitHub).
  • Mistake: Migrating platforms for fashion. Why it is wrong: It costs weeks and can lose audit history. Instead: Decide on where code, backlog and compliance evidence live.
  • Mistake: Copy-pasting YAML across dozens of repos. Why it is wrong: Fixes must be applied everywhere. Instead: Use templates or reusable workflows, versioned like code.
  • Mistake: Assuming GitHub wait timers equal business-hours checks. Why it is wrong: A wait timer only delays; it doesn't enforce a window. Instead: Use a custom deployment protection rule or a scripted check.

🏛 Senior insight: trade-offs

I treat the CI/CD platform as part of the organisation's control system, not just a build tool. The questions that decide it are: where do code and backlog live, where must auditors find approval evidence, and who owns the shared templates? Technically, both platforms can deliver secretless, approved, repeatable deployments.

Whatever the platform, put the controls on the resources (environments, identities, connections), not in individual pipelines, and give a platform team ownership of versioned templates or reusable workflows.

Option When it fits Cost When not to
GitHub Actions Code on GitHub; new teams; open-source style collaboration Some enterprise checks need custom rules Organisation is deeply invested in Boards/Test Plans
Azure DevOps Pipelines Azure Repos/Boards estate, rich resource checks, ITIL processes Fewer new features, smaller marketplace Code is on GitHub (don't cross-wire)
Both, split by team Large, mixed estates during migration Two sets of templates, skills and controls Long term without a plan

🔗 Follow-ups the interviewer may ask

  1. When: Candidate describes a multi-stage pipeline with a production approval. Why: Checks how the candidate places database migrations into staged pipelines with approvals.
    How to answer

    I generate migrations locally with dotnet ef migrations add, then make deployment a separate, reviewed step. The pipeline produces an artefact: either an idempotent SQL script (dotnet ef migrations script --idempotent) for a DBA to review, or a migration bundle (dotnet ef migrations bundle), a self-contained executable that applies pending migrations. That artefact runs once, before the new app version starts, with a dedicated deployment identity. I avoid Database.Migrate() at startup because several instances can race, the app needs DDL permissions it shouldn't have, and a failed migration turns into a crash loop.

  2. When: Candidate says they would pick GitHub Actions. Why: Checks that the candidate can write a real GitHub Actions workflow with OIDC and environment gating.
    How to answer

    The workflow has a build job (restore, build, test, dotnet publish /t:PublishContainer to push an image tagged with the commit SHA to Azure Container Registry) and deploy jobs per environment that reuse that same image.

    For Azure access I use OpenID Connect: the job declares permissions: id-token: write, GitHub issues a short-lived token, and azure/login exchanges it for an Entra token through a federated credential on an app registration or user-assigned managed identity. No client secret is stored anywhere.

    Production is gated with a GitHub environment that has required reviewers, and the federated credential's subject is scoped to environment:production, so only an approved job can get production access.

    The trade-off: OIDC needs one-off Entra setup per repo and environment, but removes secret rotation and leaked-secret risk entirely.

  3. When: Candidate mentions workload identity federation or service connections. Why: Checks secretless authentication and least-privilege identities on either platform.
    How to answer

    My rule is to remove secrets rather than protect them. The pipeline authenticates to Azure with OIDC / workload identity federation: the CI platform issues a short-lived token that Entra trusts, so no client secret is stored. The app authenticates to SQL, Storage and Key Vault with managed identity. Remaining secrets (third-party API keys) live in Key Vault; the pipeline deploys only a Key Vault reference such as @Microsoft.KeyVault(VaultName=...;SecretName=...) as an app setting, and the platform resolves it with the app's identity, so the value never passes through the pipeline.

    Pipeline identities are least privilege: one per environment, roles on a resource group, protected by environment approvals. Secret scanning with push protection blocks committed secrets.

    If a secret leaks, I revoke and rotate first, then clean logs, then check access logs. The trade-off is up-front identity setup in exchange for nothing worth stealing in the pipeline.

↩ Usually asked after

More in CI/CD

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me