-
azure.yaml - Main azd project definition
- Defines 3 services: StoreFront, AdminSite, ProductWorker
- Configures Docker builds and Kubernetes deployments
- Sets up deployment hooks
-
.gitignore - Updated to exclude azd files
- Ignores
.azure/directory (contains secrets) - Ignores
*.final.yamlfiles (generated)
- Ignores
- infra/main.bicep - Orchestrates all resources
- infra/main.parameters.json - Parameter mappings
- infra/abbreviations.json - Naming conventions
- identity.bicep - User-assigned managed identity for AKS
- acr.bicep - Azure Container Registry with role assignments
- aks.bicep - Azure Kubernetes Service with workload identity
- cosmosdb.bicep - CosmosDB with databases and containers
- servicebus.bicep - Service Bus namespace and queue
- keyvault.bicep - Key Vault with RBAC roles
- keyvault-secrets.bicep - Secrets storage in Key Vault
- openai.bicep - Azure OpenAI with model deployment
Located in infra/hooks/:
-
postprovision.ps1 / postprovision.sh
- Runs after
azd provision - Gets AKS credentials
- Creates Kubernetes namespace
- Updates SecretProviderClass manifests with actual values
- Runs after
-
postdeploy.ps1 / postdeploy.sh
- Runs after
azd deploy - Applies Kubernetes ConfigMaps
- Applies SecretProviderClass resources
- Deploys applications to AKS
- Displays service URLs
- Runs after
- .azure/ - Environment-specific settings
.gitignore- Ensures secrets aren't committedREADME.md- Explains directory purpose
- AZD-SETUP.md - Comprehensive setup guide
- Installation instructions
- Step-by-step deployment
- Environment management
- Troubleshooting tips
- Comparison with old approach
Updated all SecretProviderClass files to use variable placeholders:
k8s/keyvault-cosmosdb-spc.yamlk8s/keyvault-servicebus-spc.yamlk8s/keyvault-openai-spc.yamlk8s/keyvault-openai-key-spc.yamlk8s/keyvault-openai-deployment-spc.yaml
-
azd up(or individual commands): -
Provision Phase (
azd provision):- Deploys
infra/main.bicepto Azure - Creates all infrastructure resources
- Stores outputs in environment variables
- Runs
postprovisionhook:- Gets AKS credentials
- Generates
.final.yamlfiles with actual values
- Deploys
-
Package Phase (
azd package):- Builds Docker images for each service
- Pushes images to Azure Container Registry
-
Deploy Phase (
azd deploy):- Updates Kubernetes deployments with new image tags
- Runs
postdeployhook:- Applies all Kubernetes manifests
- Displays service URLs
| PowerShell Script | Bicep Module | Status |
|---|---|---|
create-acr-images.ps1 |
core/acr.bicep + azd package |
✅ Automated |
create-aks.ps1 |
core/aks.bicep + core/identity.bicep |
✅ Automated |
create-cosmosdb.ps1 |
core/cosmosdb.bicep |
✅ Automated |
create-servicebus.ps1 |
core/servicebus.bicep |
✅ Automated |
create-keyvault.ps1 |
core/keyvault.bicep |
✅ Automated |
deploy-openai.ps1 |
core/openai.bicep |
✅ Automated |
upload-secrets-to-keyvault.ps1 |
core/keyvault-secrets.bicep |
✅ Automated |
update-secretstoreyaml.ps1 |
postprovision hook |
✅ Automated |
set-customlabel.ps1 |
Integrated in core/aks.bicep |
✅ Automated |
| kubectl commands | postdeploy hook |
✅ Automated |
| Task | PowerShell Scripts | azd |
|---|---|---|
| Configuration | Edit scripts/env.conf |
azd env new <name> |
| Full deployment | Run 7+ scripts in sequence | azd up |
| Resource naming | Manual, must ensure uniqueness | Auto-generated, unique |
| Multiple environments | Edit env.conf each time | azd env new <env> |
| State tracking | Manual | Automatic |
| CI/CD setup | Manual pipeline creation | azd pipeline config |
✅ Creates all Azure resources in correct order
✅ Manages dependencies between resources
✅ Assigns proper RBAC roles
✅ Stores connection strings as secrets
✅ Configures AKS with workload identity
✅ Builds and pushes Docker images
✅ Updates Kubernetes manifests
✅ Deploys applications to AKS
✅ Tracks environment state
✅ Supports multiple environments (dev/test/prod)
- Single Command Deployment:
azd upreplaces 10+ manual steps - Environment Isolation: Separate dev/test/prod environments
- Infrastructure as Code: All resources defined in version-controlled Bicep
- Idempotent: Safe to run multiple times
- CI/CD Ready: Easy GitHub Actions or Azure DevOps integration
- Secure by Default: RBAC, managed identities, Key Vault integration
- Reproducible: Same deployment every time
- Install azd:
winget install microsoft.azd - Read the guide: AZD-SETUP.md
- Deploy:
azd up - Set up CI/CD:
azd pipeline config
- The original PowerShell scripts in
scripts/are preserved for reference - The original
README.mdexplains the manual process - All azd deployments create resources with consistent naming using the environment name
- Secrets are automatically rotated between the Key Vault and AKS via the CSI driver
- azd Issues: https://github.com/Azure/azure-dev/issues
- Project Issues: Use GitHub Issues in this repository
- Documentation: Microsoft Learn - Azure Developer CLI