Microsoft Certified: Azure DevOps Engineer Expert

Microsoft Certified: Azure DevOps Engineer Expert Fundamentals — Quiz 1

Microsoft Certified: Azure DevOps Engineer Expert Fundamentals — Quiz 1 — Study Guide

Azure DevOps Engineer Expert Fundamentals: Git, Version Control & IaC

Mastering Git and Infrastructure as Code is non-negotiable for any Azure DevOps engineer. These tools form the backbone of modern software delivery — enabling teams to collaborate safely, track every change, automate deployments, and recover from mistakes quickly. Whether you're managing source code or cloud infrastructure, understanding these concepts will make you a far more effective engineer.


Version Control Fundamentals

What Is Version Control?

Version control systems (VCS) track changes to files over time, allowing you to recall specific versions later. The primary purpose is to manage code history, enable collaboration, and prevent accidental data loss.

Centralized vs. Distributed

TypeExampleHow It Works
CentralizedSVN, TFSSingle server holds all history
DistributedGit, MercurialEvery developer has a full copy of the repo
Git is a distributed version control system (DVCS). This means every clone is a complete repository — you can commit, branch, and view history entirely offline.


Core Git Concepts

Cloning a Repository

git clone creates a full local copy of a remote repository, including all branches and history.

git clone https://github.com/org/my-repo.git

Think of it like downloading not just the files, but the entire project diary.

Branches

A branch is an independent line of development — a lightweight, movable pointer to a specific commit. Branches let you work on features or fixes without affecting the main codebase.

git branch feature/login    # Create a branch
git checkout feature/login  # Switch to it

or shorthand:

git checkout -b feature/login

HEAD

HEAD is a special pointer that tells Git where you currently are in the repository. Normally it points to the tip of your current branch. If you checkout a specific commit (not a branch), you enter a detached HEAD state — changes won't belong to any branch unless you create one.

git checkout abc1234   # Detached HEAD — be careful!
git checkout -b rescue-branch  # Save your work by creating a branch


Merging, Rebasing & Cherry-Picking

Merge

git merge combines two branches. A fast-forward merge happens when the target branch has no new commits — Git simply moves the pointer forward, no merge commit needed.

git checkout main
git merge feature/login   # Fast-forward if main hasn't diverged

Rebase

git rebase replays your commits on top of another branch, creating a linear history. It's cleaner than merge but rewrites commit history — avoid rebasing shared branches.

git rebase main   # Replay current branch commits on top of main

Cherry-Pick

Apply a single specific commit from one branch to another:

git cherry-pick abc1234


Undoing Changes

Revert

git revert creates a new commit that undoes a previous one — safe for shared branches because it doesn't rewrite history.

git revert abc1234

Stash

Temporarily shelve uncommitted changes so you can switch context:

git stash        # Save current work
git stash pop    # Restore it later

Filter-Branch

A powerful (and dangerous) command to rewrite history across many commits — often used to remove sensitive data like accidentally committed passwords.

git filter-branch --tree-filter 'rm -f secrets.txt' HEAD


Advanced Git Tools

Fetch vs. Pull

CommandWhat It Does
git fetchDownloads remote changes but does NOT merge them
git pullFetches AND merges remote changes into your branch
Use fetch when you want to inspect changes before integrating them.

Bisect

git bisect uses binary search to find which commit introduced a bug:

git bisect start
git bisect bad         # Current commit is broken
git bisect good v1.0   # This version was fine

Git checks out midpoints until the culprit is found

Submodule

A submodule embeds one Git repository inside another — useful for shared libraries:

git submodule add https://github.com/org/shared-lib.git libs/shared

.gitignore

The .gitignore file tells Git which files to never track — like build artifacts, secrets, or OS files:

node_modules/
*.env
bin/
.DS_Store


Azure Repos, Pull Requests & Policies

Azure Repos

Azure Repos is Microsoft's cloud-hosted Git service inside Azure DevOps. It supports standard Git workflows and integrates tightly with pipelines, boards, and test plans.

Pull Requests & Code Review

A pull request (PR) is a formal request to merge one branch into another. It's the primary mechanism for code review — teammates inspect changes, leave comments, and approve or request revisions before code lands in main.

Branch Policies

In Azure Repos, you can enforce policies on protected branches:
  • Require a minimum number of reviewers
  • Require linked work items
  • Require passing build pipelines before merge
  • Prevent force pushes
  • These policies enforce quality gates automatically, reducing human error.

    Security

    Azure Repos supports granular permissions — you can control who can read, push, or manage branches at the repository or branch level. Combined with policies, this protects your main branch from unauthorized or untested changes.


    Infrastructure as Code (IaC) & ARM Templates

    What Is IaC?

    Infrastructure as Code (IaC) means managing and provisioning cloud resources through code files rather than manual portal clicks. Benefits include repeatability, version control, and automation.

    ARM Templates

    Azure Resource Manager (ARM) Templates are Microsoft's native IaC format. They are written in JSON and describe the desired state of Azure resources.

    {
      "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "resources": [
        {
          "type": "Microsoft.Storage/storageAccounts",
          "apiVersion": "2021-02-01",
          "name": "mystorageaccount",
          "location": "[resourceGroup().location]",
          "sku": { "name": "Standard_LRS" },
          "kind": "StorageV2"
        }
      ]
    }

    ARM templates are stored in Git repos, reviewed via pull requests, and deployed through pipelines — connecting IaC directly to DevOps workflows.


    Key Takeaways

  • Git is a distributed VCS — every developer has a complete copy of the repository, enabling offline work and resilience.
  • Branches, merges, and pull requests form the collaboration backbone; Azure Repos adds policies and security to enforce quality gates.
  • HEAD points to your current location; a detached HEAD means you've checked out a commit directly rather than a branch.
  • ARM Templates are written in JSON and represent Azure infrastructure as code, enabling repeatable, version-controlled deployments.
  • Commands like revert, stash, bisect, and cherry-pick give you precise control over history — knowing when to use each is a key DevOps skill.