AZD for Beginners

Module 18 of 20

Module 18: Production Best Practices

4 min read776 words
What you'll learn
Identify what makes a deployment production-readyApply security, reliability, and cost best practicesAutomate deployments with CI/CDUnderstand responsible AI in production

"A demo that works once and a system that runs reliably for a year are very different things. Here's how to make your azd app production-grade."

Level: Beginner · Time: ~2 days · Prerequisites: Modules 11, 15–17

Learning Objectives

By the end of this module, you will be able to:

  • Identify what makes a deployment production-ready
  • Apply security, reliability, and cost best practices
  • Automate deployments with CI/CD
  • Understand responsible AI in production

1. From "It Works" to "It's Ready"

Getting an app live is step one. Production-readiness adds the qualities real systems need: security, reliability, observability, scalability, and cost control. A demo only has to work once, for you, on a good day; a production system has to work at 3 a.m., for strangers, under load, and after a dependency hiccups. azd gives you a strong start — secure defaults, repeatable infrastructure, monitoring hooks — and these practices carry it the rest of the way.

Concept: Production is a standard, not a place. An app is "production-ready" when you'd trust it with real users, real data, and real money — not just a happy-path demo.

2. Security, Reliability, Cost

Three pillars to check before you call something production-ready:

PillarPractices
SecurityManaged identities, Key Vault, least privilege, HTTPS (Module 11)
ReliabilityHealth checks, retries, multiple instances, monitoring/alerts
CostRight-sized SKUs, autoscale down, budget alerts (Module 15)

Common mistake: Shipping with a giant "just in case" SKU running 24/7. Size to real demand and let it scale — over-provisioned resources quietly burn budget for performance you never use.

3. Automate with CI/CD

Deploying by hand from a laptop doesn't scale and invites mistakes. azd can wire up a CI/CD pipeline so every push tests and deploys automatically:

bash
azd pipeline config

This sets up GitHub Actions (or Azure DevOps) to run azd provision and azd deploy on your behalf whenever you push — consistent, automated releases. It also configures the credentials the pipeline needs to authenticate to Azure, so the same command that deploys from your laptop now runs in the cloud, the same way, for every teammate.

Concept: CI/CD makes deployment boring — in the best way. The same tested steps run every time, so releases stop being risky, manual events and become routine.

4. Responsible AI in Production

AI apps carry extra duties. In production, add content safety filters, monitor for harmful or low-quality outputs, watch token cost, and be transparent that users are talking to AI. Azure provides content-safety tools you can wire in to screen both what users send and what the model replies. Treat these as launch requirements, not nice-to-haves: an unfiltered model in front of the public is a headline waiting to happen.

Real-world use case: A team launches an AI assistant with content-safety filters on inputs and outputs, dashboards tracking token spend and refusal rates, and alerts for error spikes — so they catch problems and control costs from day one, not after an incident.

5. The Production Checklist

Before you flip the switch, confirm: secrets are in Key Vault / identities (not code), monitoring and alerts are on, capacity and quota are sized (Module 15), CI/CD is set up, backups or a clean redeploy path exist so azd down never means permanent loss, and — for AI — safety and cost controls are in place. Turn the list into a pull-request checklist your team ticks off before every release, and "production-ready" stops being a vibe and becomes a repeatable gate.

Try this: Run your favorite azd app through the three pillars — security, reliability, cost. Any "no" is a concrete to-do that moves it closer to production-ready.

✅ Checkpoint

  1. What are the three pillars of a production-ready app?
  2. What does azd pipeline config set up?
  3. Name two responsible-AI practices for production.

Answers: 1) Security, reliability, and cost. 2) A CI/CD pipeline (e.g., GitHub Actions) that runs azd provision/deploy automatically. 3) Any two: content-safety filters, monitoring outputs for harm/quality, tracking token cost, transparency that it's AI.

Key Takeaway: Production-readiness means meeting a standard across security (identities, Key Vault, least privilege), reliability (health checks, monitoring, alerts), and cost (right-sized, autoscaling). Automate releases with azd pipeline config so deployments are consistent and low-risk, and for AI apps add responsible-AI practices — content safety, output monitoring, and cost control — before you go live.

Further Learning

Part of "AZD for Beginners." Adapted from Microsoft's open AZD curriculum (MIT License).