What Is CD in DevOps?
On This Page
Quick Definition
Continuous Delivery (CD) is a DevOps practice that makes sure your code is always ready to be released. Every time a developer makes a change, it is automatically tested and prepared for deployment. This means teams can release updates safely and quickly at any time.
Commonly Confused With
CI is the practice of frequently merging code changes and automatically running builds and tests. CD includes CI and adds the release and deployment automation. CI happens before CD in the pipeline. Without CI, there is no validated code to deliver.
CI is like having a smoke alarm that checks for fire in the kitchen every time you cook. CD is like having a fire extinguisher system that is always ready to deploy if the alarm goes off.
Continuous Deployment goes one step further than Continuous Delivery. In CDelivery, you still need a human to approve the final release. In CDeployment, every change that passes tests goes directly to production with no human intervention.
With Continuous Delivery, you have a 'Launch' button that you press after QA gives a thumbs‑up. With Continuous Deployment, the button is pressed automatically by the system every time tests pass.
IaC is about managing servers, networks, and environments using code and version control. CD is about deploying application code automatically. They often work together: CD pipelines run IaC scripts to provision environments, but they are different concepts.
IaC is like having a set of blueprints and a robot that builds the hotel rooms. CD is the system that automatically moves the guests into the rooms once they are built.
Must Know for Exams
In the Microsoft AZ-400 exam (Designing and Implementing Microsoft DevOps Solutions), Continuous Delivery is a core objective. The exam specifically tests your understanding of how to design a release strategy, manage release pipelines in Azure DevOps, and implement deployment patterns like blue-green and canary releases. Questions often focus on configuring approvals, gates, and triggers in Azure Pipelines; understanding artifact versioning and promotion; and integrating with monitoring tools to validate deployments.
You may be asked to choose the correct deployment strategy for a given scenario. For example, a scenario asks for a deployment that minimizes risk when rolling out a new feature to a global user base. The correct answer might be a canary release, and you need to know how to set it up using Azure Deployment Slots or feature flags. Another question might involve a broken release: you must know how to roll back using a previous version stored in an artifact repository. The exam also tests your knowledge of branch policies related to CD: for instance, requiring certain gates (like manual approval from a QA lead) before promoting a build to production.
Understanding CD at a technical level, not just the concept, is critical. You need to know the difference between CD and Continuous Deployment (the latter is fully automated with no manual step). The exam will include questions about pipeline YAML syntax, artifact feeds, and release variables. You also need to understand how CD integrates with CI: the CI pipeline builds and tests the code, and the CD pipeline deploys it. If you confuse the two, you will lose points. Finally, expect scenario-based questions where you have to select the proper release trigger (e.g., continuous deployment trigger vs. scheduled trigger) based on business requirements.
Simple Meaning
Think of Continuous Delivery like a restaurant kitchen that prepares meals to order, but keeps all ingredients prepped and ready. In a traditional kitchen, when a customer orders a dish, the chef starts from scratch: chopping vegetables, marinating meat, boiling sauce. That takes time, and many things can go wrong: the vegetables might be old, the sauce could burn, or the meat might not be fully thawed. Now imagine a kitchen where everything is already prepped: vegetables are chopped and stored, sauces are pre-made, and meats are marinated. When an order comes in, the chef just finishes the dish quickly and reliably.
In software development, every change a developer makes is like a new ingredient arriving at the kitchen. Continuous Delivery is the process that automatically cleans, chops, and prepares that ingredient so it is always ready to be served (deployed to production). The code is automatically built into an application, run through a series of tests (like a health inspection for your code), and then stored in a ready state. If the business decides to release the new feature, it can be deployed at the push of a button, or even completely automatically. This removes the last-minute panic, the late-night manual deployments, and the fear that a rushed release will break everything. It gives teams the confidence to deliver value to users faster and more frequently, because every change has already been proven to be safe.
Full Technical Definition
Continuous Delivery (CD) is a software engineering practice that extends Continuous Integration (CI) by ensuring that every code change that passes the automated build and test pipeline is automatically deployable to production. While CI focuses on merging code changes frequently and verifying them with automated builds and tests, CD takes it a step further: it packages the validated code, configures the deployment artifacts, and stages them in a production-like environment. The key principle is that the software is always in a deployable state.
Technically, CD relies on a deployment pipeline. This pipeline includes stages beyond the CI build and test phase. After the code is integrated and tested, it is built into a deployable artifact (such as a Docker container, a JAR file, or a VM image). This artifact is then promoted through multiple environments: development, test, staging, and production. Each environment runs its own suite of automated tests, such as integration tests, performance tests, and security scans. The pipeline ensures that the same artifact that passed tests in staging is the exact same artifact deployed to production, eliminating configuration drift and 'it worked on my machine' issues.
Key components of a CD pipeline include version control (e.g., Git), artifact repositories (e.g., JFrog Artifactory, Docker Hub), infrastructure as code tools (e.g., Terraform, Ansible), and deployment automation tools (e.g., Azure Pipelines, Jenkins, Spinnaker). The pipeline uses triggers: when a commit is pushed to a specific branch (usually main or master), the pipeline automatically kicks off. It uses blue-green deployments or canary releases to test the new version in production with a small subset of users before rolling out to everyone. Feature flags also play a role, allowing teams to deploy code to production but keep new features turned off until they are ready to be enabled.
From an IT implementation perspective, CD requires a mature testing strategy. Unit tests run first for speed, then integration tests verify interactions between services, then acceptance tests validate the system from the end user's perspective. The pipeline must be fast enough to provide feedback within minutes, not hours. It also requires strong versioning and rollback strategies. If a deployment fails, the pipeline should automatically roll back to the last known good version. Tools like Azure DevOps (related to AZ-400 exam) provide built-in pipelines that support CD with approvals, gates, and manual intervention steps for compliance-heavy environments.
Real-Life Example
Imagine you are a musician in a band preparing for a concert. In an old-fashioned approach, you would show up on the day of the concert, tune your guitar for the first time in weeks, and hope you remember all the lyrics. That is risky. Now imagine you have a regimen: every day you practice your parts, your bandmates send recordings back and forth, and the sound engineer mixes everything digitally before the show. When concert day arrives, you are already fully prepared. You just walk on stage, plug in, and play.
Continuous Delivery is like that daily practice and mixing process. The code changes are the new riffs or lyrics you write. The CD pipeline is your rehearsal routine: it takes your new riff, runs it through a digital audio workstation (builds it), plays it alongside the old songs (integration tests), and checks that the tempo matches (performance tests). Once everything sounds good, the mix is saved as a final track (deployment artifact). On show day (release day), you just hit play. There is no scrambling, no forgotten chords, no blown amplifiers. If something does go wrong in rehearsal, you fix it immediately and rehearse again. By the time you step on stage, your music is proven to work. That is what CD does for software: it rehearses every change rigorously so that going live is as simple and safe as pressing a button.
Why This Term Matters
Continuous Delivery matters because it directly affects how fast and safely a business can deliver value to its customers. In traditional software development, releases were large, infrequent events: every six months or year, a huge batch of changes would be merged and deployed. This led to long release cycles, high stress, and frequent failures. A single bug could delay an entire release for weeks. Customers had to wait months for new features or bug fixes.
With Continuous Delivery, organizations can release multiple times per day. This reduces the risk of each release because smaller changes are easier to test and debug. If a bug is introduced, it is caught quickly and the fix is also deployed quickly. This leads to higher quality software, faster feedback from users, and a competitive advantage. For IT professionals, CD means less manual, repetitive work (like copying files to servers) and more focus on building features and improving the pipeline. It also creates a culture of automation and trust: the pipeline handles the boring, error-prone parts of deployment, freeing humans to make decisions.
In practical terms, CD is essential for modern cloud-native applications and microservices architectures. These systems have many moving parts; manually deploying each service would be impossible. CD pipelines ensure that every microservice is independently deployable and that dependencies are managed. It also supports compliance and auditability: every deployment is recorded, every test result is logged, and approvals can be built into the pipeline. For organizations undergoing digital transformation, CD is a foundational practice that enables agility, reliability, and speed.
How It Appears in Exam Questions
In the AZ-400 exam, CD questions come in three main patterns: scenario-based design, configuration steps, and troubleshooting.
Scenario-based design: You are given a company that wants to release web application updates twice a day with zero downtime. They have a multi-tier architecture with web front ends, APIs, and databases. The question asks which deployment pattern to use. You need to choose from options like blue-green deployment, rolling deployment, canary release, or feature flags. The correct answer often involves blue-green deployments for zero downtime, but you must also consider whether they need to test with a subset of users (canary) or need to toggle features on/off (feature flags). Sometimes the question specifies a regulatory requirement for manual approval before production deployment, which tests your understanding of deployment gates.
Configuration steps: A question might present a YAML pipeline snippet and ask what it does. For example, a snippet includes a 'deployment' job with an 'environment' target and a 'strategy' key. You need to identify the deployment strategy (runOnce, rolling, canary). Another question could ask: 'Which task should you add to a release pipeline to ensure that only artifacts with a specific tag are deployed to production?' The answer is to use artifact filters or a pre-deployment gate that queries the artifact feed.
Troubleshooting: A scenario where a deployment to staging succeeds but the application fails after the production deployment. You are asked what the most likely cause is. Common traps include configuration differences between staging and production (staging uses a test database, production uses live data), missing environment-specific variables, or using a different build artifact for production. The correct troubleshooting step is to verify that the exact same artifact was deployed to both environments and that configuration files are parameterized.
Study AZ-400
Test your understanding with exam-style practice questions.
Example Scenario
A company called 'RapidShop' runs an e-commerce website. They currently follow a monthly release cycle: developers work for four weeks, then the release manager manually builds the application and copies it to servers late at night. This is stressful, and they recently had an outage when a developer forgot to include a configuration file in the manual build.
RapidShop decides to implement Continuous Delivery. First, they set up a CI pipeline in Azure Pipelines that triggers whenever code is pushed to the main branch. The CI pipeline builds the application into a Docker container, runs unit tests and integration tests, and pushes the container to Azure Container Registry. This is the CI part: every change is automatically validated.
Next, they build a CD pipeline. The CD pipeline has three stages: Dev, Staging, and Production. When a new container image is pushed to the registry, the Dev stage automatically deploys it to a development environment. In Dev, automated acceptance tests run. If they pass, the pipeline promotes the same image to Staging. In Staging, a QA team member has to manually approve the deployment (a deployment gate). In Staging, they run performance tests and security scans. Finally, to go to Production, the pipeline uses a blue-green deployment: it spins up a new instance (green) alongside the old one (blue), runs a health check, and then switches traffic to the green instance. If the health check fails, the pipeline automatically rolls back to the blue instance.
Now, when a developer pushes a fix for a product search bug, the fix is built, tested, and ready for release within 30 minutes. The QA lead can approve it during business hours, and the production deployment happens with zero downtime. RapidShop can now release multiple times a day without fear of outages.
Common Mistakes
Confusing Continuous Delivery with Continuous Deployment
Continuous Delivery means every change is deployable but requires manual approval to go to production. Continuous Deployment eliminates the manual approval and deploys every change automatically to production.
Remember: Delivery requires a human to push the final button; Deployment is fully automated.
Skipping the integration tests in the CD pipeline
If you only run unit tests, you miss conflicts between services. This can break production because the services don't work together correctly.
Include integration, performance, and acceptance tests in the pipeline before promoting to production.
Using different artifacts for different environments
If you rebuild the application for each environment, you introduce variability. A bug that only appears in production might be because the production artifact is different from the one tested in staging.
Build the artifact once in the CI pipeline and promote the same artifact through all stages unchanged.
Not including a rollback strategy in the pipeline
Without an automated rollback, if a deployment fails, manual intervention is needed, which takes time and increases downtime.
Configure the pipeline to automatically revert to the previous version if health checks fail after deployment.
Exam Trap — Don't Get Fooled
{"trap":"The exam presents a scenario where a team wants to release 'continuously' and asks for the best CI/CD practice. Learners often pick Continuous Deployment because it sounds like the most advanced version, but the scenario includes a manual approval gate, which means the correct answer is Continuous Delivery.","why_learners_choose_it":"Learners think 'Continuous' automatically means fully automated, and they might not read the details about manual approval or compliance requirements."
,"how_to_avoid_it":"Read the scenario carefully. If you see any mention of manual approval, sign-off, or compliance review, the answer is Continuous Delivery, not Continuous Deployment. Memorize the difference: Delivery = always ready to deploy, Deployment = automatically deploys."
Step-by-Step Breakdown
Develop & Commit
A developer writes new code or fixes a bug and pushes the changes to a version control repository like Git. This triggers the entire CD pipeline.
Continuous Integration (CI) Build & Test
The code is compiled, and unit tests and integration tests run. If any test fails, the pipeline stops and the developer is notified. This ensures only high-quality code moves forward.
Artifact Creation & Storage
After tests pass, the code is packaged into a deployable artifact (e.g., Docker image, JAR file, or zip). The artifact is tagged with a version and stored in a central artifact repository (e.g., Azure Container Registry).
Deploy to Staging Environment
The CD pipeline automatically deploys the artifact to a staging environment that mirrors production. Additional tests like performance tests, security scans, and acceptance tests run here.
Manual Approval or Gate Check
Depending on the policy, a human (like a release manager) or an automated gate (e.g., a monitoring system that checks for errors) approves the promotion to production. This is the 'Delivery' part, the artifact is ready but not yet released without approval.
Deploy to Production
Once approved, the pipeline deploys the artifact to production using a safe strategy (blue-green, canary, rolling). Health checks run after deployment to verify the system works as expected.
Monitor & Rollback
The pipeline monitors production health metrics (error rates, latency, CPU usage). If issues are detected, the pipeline automatically triggers a rollback to the previous known good version. The team then investigates the root cause.
Practical Mini-Lesson
In practice, implementing Continuous Delivery requires more than just setting up a pipeline. You need to design the pipeline with the right balance of speed and safety. First, you must define the deployment strategy. For a critical application like a banking system, you might use blue-green deployments: you spin up a completely new set of servers, deploy the new artifact, run health checks, and only then redirect traffic. For a less critical internal tool, a rolling update that gradually replaces old servers with new ones might be sufficient.
Next, configuration management is crucial. You should never hard-code environment-specific values in your application. Instead, use variables and secrets stored in Azure Key Vault or Azure DevOps Variable Groups. The pipeline should pull the correct values for each environment. This prevents the mistake of accidentally using the staging database connection string in production.
In real-world implementations, professionals must also consider deployment gates. For example, if you are deploying to a government cloud, a compliance officer must manually approve the release. Azure Pipelines allows you to add pre-deployment and post-deployment gates that check things like manual approvals, Azure Monitor alerts, or even HTTP endpoints that must return a specific status.
What can go wrong? The most common issue is pipeline leakage: a build breaks in staging because of a configuration error, but the team fixes it by manually patching the staging environment instead of fixing the code. This leads to configuration drift, and the next deployment to production fails because production doesn't have the manual patch. The fix is strict discipline: never manually modify an environment; always change the code and let the pipeline redeploy.
Another issue is long pipeline times. If your CD pipeline takes 90 minutes to run, developers will start working around it. To speed up the pipeline, you can parallelize test runs, use caching for dependencies, and choose lighter testing strategies for early stages (e.g., only unit tests in CI, then deeper tests in CD). As a professional, you should constantly monitor pipeline performance and optimize it.
Memory Tip
Delivery is different from Deployment: Delivery needs a 'Yes' from a human; Deployment does it on its own.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
Related Glossary Terms
A/B testing is a controlled experiment that compares two versions of a single variable to determine which one performs better against a predefined metric.
Two-factor authentication (2FA) is a security method that requires two different types of proof before granting access to an account or system.
Frequently Asked Questions
What is the difference between CI and CD?
CI (Continuous Integration) is the practice of merging all developer code changes into a shared repository frequently, with automated builds and tests. CD (Continuous Delivery) extends CI by automatically preparing the validated code for release, so it is always deployable to production with a manual approval.
Do I always need a manual gate in CD?
No. Some teams choose Continuous Deployment which removes the manual gate entirely. However, many enterprises keep a manual gate for compliance or risk reasons. The AZ-400 exam expects you to know both models.
What tools does Azure DevOps provide for CD?
Azure DevOps provides Release Pipelines (classic editor) and multi-stage YAML pipelines, deployment environments, approvals and gates, artifact feeds, and integration with Azure App Service, Kubernetes, and virtual machines.
Can CD be used with databases?
Yes, but database changes require special care. You need to use migration scripts that are idempotent (can be run multiple times safely) and include rollback scripts. Azure Pipelines can run SQL scripts or use tools like Azure SQL Database deployment tasks.
What is a blue-green deployment?
Blue-green deployment is a technique where you have two identical environments (blue and green). You deploy the new version to the inactive environment, test it, then switch traffic. This allows zero-downtime deployments and instant rollback.
How does CD relate to DevOps culture?
CD is a key DevOps practice because it automates the manual handoff between development and operations, encourages small frequent releases, and reduces the fear of change. It supports the DevOps goals of faster feedback and higher deployment frequency.
Summary
Continuous Delivery (CD) is a foundational DevOps practice that ensures your software is always in a deployable state. It builds on Continuous Integration by automatically packaging, testing, and staging every validated code change, with a manual gate before production release. This reduces deployment risk, accelerates feedback from users, and frees engineers from repetitive manual tasks.
For the AZ-400 exam, mastering CD means understanding deployment patterns (blue-green, canary, rolling), pipeline configuration in Azure DevOps, the role of artifacts and environments, and the distinction between Continuous Delivery and Continuous Deployment. Common traps include confusing these two terms and forgetting to implement rollback strategies. Remember: Delivery means a human push is required; Deployment means it is fully automatic.
In the real world, CD transforms how teams work. Instead of a panic-filled release every few months, teams can release multiple times a day with confidence. By practicing CD, you become a more effective DevOps engineer, capable of designing pipelines that are both fast and safe. This is a skill that is highly valued in modern IT organizations and is central to the AZ-400 certification.