Designing Operations and Automation: Infrastructure as Code, Pipelines, Update Management and Deployment Strategies
Principles
- Everything in code: infrastructure, configuration and pipelines in Git
- Immutable deployments: replace, do not hand-fix
- Small, frequent, reversible releases
- Automate tests and checks before production
IaC Choices
| Tool | Choose when |
|---|---|
| Bicep | Azure-only teams. Native support on day one |
| Terraform | Multi-cloud or an existing Terraform practice. Needs remote state |
| ARM JSON | Existing templates |
| Pulumi / CDK | Prefer general-purpose languages |
- Use modules and a registry for reuse
- Run what-if or plan in pull requests
- Deployment stacks manage lifecycle and prevent unwanted changes
- Separate platform pipelines (landing zones) from application pipelines
Pipeline Design
text
Pull request: lint -> unit tests -> IaC validate / what-if -> security scan (code, containers, IaC)
Merge to main: build artifact/image -> deploy to Dev -> integration tests
-> deploy to Staging -> load/smoke tests -> manual approval -> deploy to Prod -> health check -> auto rollback on failure
- Authenticate with workload identity federation (OIDC), no stored secrets
- Use environments, approvals and branch protection
- Store secrets in Key Vault; configuration in App Configuration
- Tag builds with the commit id for traceability
Deployment Strategies
| Strategy | How | Risk and cost |
|---|---|---|
| In-place / rolling | Update instances in batches | Low cost, some mixed versions |
| Blue-green | Deploy new environment, switch traffic, keep old for rollback | Fast rollback, double capacity temporarily |
| Canary | Send a small percentage of users to the new version first | Safest, needs traffic splitting and good monitoring |
| Feature flags | Ship code off, turn on gradually | Decouples deploy from release |
- App Service deployment slots: deploy to staging, warm up, swap
- Front Door or Application Gateway weighted routing for canary
- AKS rolling updates, Argo Rollouts or Flagger for canary
Patching and Configuration
| Task | Tool |
|---|---|
| OS patching schedules and compliance | Azure Update Manager |
| Desired state and guest settings | Azure Policy guest configuration, Automanage |
| Hybrid servers | Azure Arc |
| App settings and flags | App Configuration |
| Scheduled tasks and runbooks | Azure Automation, Logic Apps, Functions timers |
Practice
- Draw a pipeline with four environments and approvals
- Choose a deployment strategy for a payment service and for a marketing site
- List what must be in Git for a complete rebuild
Conclusion
Operate with code: IaC, pipelines with federated identity and approvals, safe deployment strategies such as blue-green and canary, and automated patching and configuration.
Quick Summary: principles; IaC; pipelines; strategies; patching and configuration.

