Azure Deployment Process¶
S5 uses GitHub Actions for automated deployments to Azure Container Apps.
Deployment Workflow¶
Preview Deployment¶
Trigger: Push to preview branch
Process:
- GitHub Actions workflow starts (
.github/workflows/preview.yml) - Checkout code from repository
- Login to Azure using
AZURE_CREDENTIALSsecret - Login to Azure Container Registry
- Build Docker image:
- Download
slidefactory-corewheel from GitHub releases (v1.0.8) - Copy S5 branding assets from
s5_branding/ - Install Azure dependencies
- Create application image
- Push image to Azure Container Registry with tag
preview-{sha} - Update Azure Container App with new image
- Container App performs rolling update
Preview URL: https://slidefactory-preview.sportfive.com
Duration: ~5-10 minutes
Production Deployment¶
Trigger: Push to main branch (repository owner only)
Process: Same as preview deployment, but:
- Uses
.github/workflows/production.yml - Uses
AZURE_CREDENTIALS_PRODsecret - Deploys to production resource group
- Tags image with
prod-{sha} - Updates production Container App
Production URL: https://slidefactory.sportfive.com
Duration: ~5-10 minutes
Deployment Architecture¶
Developer Push
↓
GitHub Actions
↓
Build Docker Image (with core package)
↓
Push to Azure Container Registry
↓
Update Container App
↓
Rolling Deployment (zero downtime)
Manual Deployment¶
Via Azure CLI¶
# Login to Azure
az login
# Update preview environment
az containerapp update \
--name slidefactory-web-preview \
--resource-group rg-slidefactory-preview \
--image s5slidefactory.azurecr.io/slidefactory:preview-abc123
# Update production environment (owner only)
az containerapp update \
--name slidefactory-web-prod \
--resource-group rg-slidefactory-prod \
--image s5slidefactory.azurecr.io/slidefactory:prod-abc123
Via Azure Portal¶
- Navigate to Azure Portal
- Go to Container App resource
- Select Revision Management
- Create new revision with updated image
- Activate new revision
Rollback Procedures¶
Rollback to Previous Revision¶
Azure Container Apps keeps previous revisions, allowing instant rollback:
# List revisions
az containerapp revision list \
--name slidefactory-web-preview \
--resource-group rg-slidefactory-preview \
--output table
# Activate previous revision
az containerapp revision activate \
--name slidefactory-web-preview \
--resource-group rg-slidefactory-preview \
--revision slidefactory-web-preview--abc123
Rollback Duration: ~30 seconds (instant traffic switch)
Rollback via Git¶
# Revert last commit on preview branch
git revert HEAD
git push origin preview
# Or reset to previous commit (use with caution)
git reset --hard HEAD~1
git push origin preview --force
Rollback Duration: ~5-10 minutes (full redeployment)
Pre-Deployment Checklist¶
Before merging preview → main for production deployment:
- Preview deployment successful
- Smoke tests pass on preview environment
- Database migrations applied successfully (if any)
- Environment variables updated (if needed)
- S5 branding displays correctly
- User can log in with Azure AD
- Presentations generate successfully
- N8N workflows execute properly
- No errors in Container App logs
- Performance is acceptable (response times < 2s)
Monitoring Deployment¶
GitHub Actions¶
View deployment progress:
- Go to repository on GitHub
- Click Actions tab
- Select the workflow run
- View logs for each step
Key Steps to Monitor: - Build Docker image (should complete in ~3-5 minutes) - Push to Azure Container Registry (should complete in ~1-2 minutes) - Update Container App (should complete in ~2-3 minutes)
Azure Portal¶
Monitor Container App health during deployment:
- Go to Container App resource in Azure Portal
- View Metrics for CPU/memory usage
- Check Log stream for application logs
- Review Revision management for active revision
- Check Health probes status
Healthy Deployment Indicators: - New revision shows as "Active" - Health probes return 200 OK - CPU/memory within normal range - No error logs during startup
Deployment Secrets¶
Required GitHub secrets for deployment:
Preview Environment¶
AZURE_CREDENTIALS- Azure service principal credentials for previewGH_PAT_SLIDEFACTORY_CORE- GitHub PAT to download private core package
Production Environment¶
AZURE_CREDENTIALS_PROD- Azure service principal credentials for productionGH_PAT_SLIDEFACTORY_CORE- GitHub PAT to download private core package (same as preview)
Troubleshooting Deployments¶
Issue: GitHub Actions Workflow Fails¶
Symptoms: Workflow shows red X, deployment never reaches Azure
Solutions:
- Check GitHub Actions logs for specific error
- Verify Azure credentials are valid:
az loginusing service principal - Verify GitHub PAT has access to slidefactory-core repository
- Check if Container Registry is accessible
- Verify Docker build succeeds locally
Issue: Container App Deployment Fails¶
Symptoms: Deployment reaches Azure but Container App doesn't start
Solutions:
- Check Container App logs in Azure Portal → Log stream
- Verify environment variables are set correctly in Container App configuration
- Check if database is accessible from Container App
- Verify slidefactory-core wheel exists in GitHub releases (v1.0.8)
- Check if image exists in Azure Container Registry
Issue: Database Migration Failures¶
Symptoms: App starts but shows database errors
Solutions:
- Check Container App logs for Alembic migration errors
- Manually run migrations via Azure CLI:
- Verify database connection string in environment variables
- Check if pgvector extension is installed in PostgreSQL
Issue: Application Doesn't Respond After Deployment¶
Symptoms: Deployment succeeds but app returns 502/503 errors
Solutions:
- Check health probe status in Container App
- Verify port 8000 is exposed in Dockerfile
- Check if FastAPI app starts successfully in logs
- Verify Redis connection for sessions
- Check if Azure Blob Storage is accessible
Deployment Best Practices¶
- Always test on preview first - Never deploy directly to production
- Monitor logs during deployment - Watch for errors in real-time
- Keep rollback ready - Know how to quickly rollback if needed
- Update preview frequently - Don't let preview drift from production
- Document breaking changes - Update deployment checklist for major changes
- Use semantic versioning - Tag releases in Git for tracking
- Coordinate with users - Notify users of production deployments