Continuous Deployment (CD)
Continuous deployment delivers every change that passes all automatic checks to production without a further approval. Continuous delivery, by contrast, only keeps every checked version ready for release, and a person decides.
Continuous deployment is the practice of delivering every change that passes all automatic checks of a pipeline to production without any further manual step. It builds on continuous integration.
Delivery or deployment?
The abbreviation CD stands for two things, and Microsoft keeps them apart:
- Continuous delivery: Code is automatically built, tested, and delivered to environments that resemble production. The goal: the current version is always ready for release. Whether it goes live is decided by a person.
- Continuous deployment: Whatever passes the pipeline goes to production automatically. Microsoft notes that this needs reliable automatic tests and good planning and does not suit every team.
So the two differ in only one place: who presses the last button?
What it looks like in Azure
A CD pipeline runs in GitHub Actions or Azure Pipelines. It builds a container image once, rolls out exactly this image to dev first, and to prod after an approval. Typical building blocks:
- Sign-in without a secret: The pipeline signs in to Azure through workload identity federation, without a stored password.
- Environments with approval: For
prod, an environment (GitHub environment, Azure Pipelines environment) requires reviewers. - A safe way back: A new revision first gets a share of the traffic; if there are problems, you roll back to the previous one.
- Infrastructure as code (Bicep) and telemetry as part of the delivery.
The pipeline is code in the repository and goes through the same review as the application.
An example from the Kladde
In K3, the Kladde gets a pipeline in which main goes to dev by itself and prod only after an approval. So that is continuous delivery with automatic deployment to the test environment. That the delivered image is the same one is proven by its digest.
Common misconceptions
- CD does not mean "without tests". Without good tests, automatic delivery is a risk.
- Do not forget the database. Schema changes have to work while the old version is still active.
- Not every team needs deployment without approval. Delivery with an approval is often the sensible choice.
- CD is not DevOps. It is one practice within it.
In the course
You learn delivery in K3, module 3.7: Delivering without a secret and Approvals before the deploy. You already do the first deploy of the Kladde in K2, module 2.9, with Shipping with azd.
Further reading on the blog
- Release planning: planning further development in a structured way
- Software tests: types and how to use them in a project
Sources
- Microsoft Learn, Get started with DevOps architecture design: https://learn.microsoft.com/azure/architecture/guide/devops/devops-get-started
- Microsoft Learn, What is continuous delivery?: https://learn.microsoft.com/devops/deliver/what-is-continuous-delivery