@deftai/directive-content 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/deft/SKILL.md +6 -0
- package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
- package/.agents/skills/deft-directive-build/SKILL.md +10 -0
- package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
- package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
- package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
- package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
- package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
- package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
- package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
- package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
- package/.agents/skills/deft-directive-release/SKILL.md +12 -0
- package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
- package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
- package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
- package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
- package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
- package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
- package/LICENSE.md +22 -0
- package/QUICK-START.md +167 -0
- package/UPGRADING.md +517 -0
- package/coding/build-output.md +28 -0
- package/coding/coding.md +235 -0
- package/coding/debugging.md +110 -0
- package/coding/holzmann.md +96 -0
- package/coding/hygiene.md +127 -0
- package/coding/security.md +158 -0
- package/coding/testing.md +162 -0
- package/coding/toolchain.md +44 -0
- package/commands.md +300 -0
- package/context/context.md +57 -0
- package/context/deterministic-split.md +67 -0
- package/context/examples.md +26 -0
- package/context/fractal-summaries.md +69 -0
- package/context/long-horizon.md +46 -0
- package/context/spec-deltas.md +177 -0
- package/context/tool-design.md +34 -0
- package/context/working-memory.md +62 -0
- package/contracts/boundary-maps.md +65 -0
- package/contracts/deterministic-questions.md +59 -0
- package/contracts/hierarchy.md +77 -0
- package/conventions/content-manifest.json +399 -0
- package/conventions/machine-generated-banner.md +130 -0
- package/conventions/references.md +120 -0
- package/conventions/rule-ownership.json +382 -0
- package/conventions/task-caching.md +43 -0
- package/conventions/vbrief-filenames.md +70 -0
- package/deployments/README.md +37 -0
- package/deployments/agentuity/README.md +138 -0
- package/deployments/agentuity/via-cli.md +380 -0
- package/deployments/agentuity/via-cloud.md +425 -0
- package/deployments/agentuity/via-github-actions.md +664 -0
- package/deployments/agentuity/via-gravity-network.md +606 -0
- package/deployments/agentuity/via-vpc.md +607 -0
- package/deployments/aws/README.md +38 -0
- package/deployments/aws/via-app-runner.md +612 -0
- package/deployments/aws/via-ecs-fargate.md +561 -0
- package/deployments/aws/via-elastic-beanstalk.md +628 -0
- package/deployments/aws/via-lambda.md +649 -0
- package/deployments/azure/README.md +37 -0
- package/deployments/azure/via-aks.md +390 -0
- package/deployments/azure/via-app-service.md +564 -0
- package/deployments/azure/via-container-apps.md +599 -0
- package/deployments/azure/via-functions.md +552 -0
- package/deployments/cloud-gov/README.md +63 -0
- package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
- package/deployments/cloud-gov/agents.md +39 -0
- package/deployments/cloud-gov/cicd.md +64 -0
- package/deployments/cloud-gov/deployment.md +150 -0
- package/deployments/cloud-gov/logging.md +43 -0
- package/deployments/cloud-gov/manifest.md +121 -0
- package/deployments/cloud-gov/overview.md +58 -0
- package/deployments/cloud-gov/security.md +46 -0
- package/deployments/cloud-gov/services.md +72 -0
- package/deployments/cloud-gov/upstream/README.md +18 -0
- package/deployments/cloudflare/README.md +33 -0
- package/deployments/cloudflare/via-dashboard.md +83 -0
- package/deployments/cloudflare/via-git.md +90 -0
- package/deployments/cloudflare/via-github-actions.md +185 -0
- package/deployments/cloudflare/via-terraform.md +157 -0
- package/deployments/cloudflare/via-wrangler.md +165 -0
- package/deployments/fly-io/README.md +37 -0
- package/deployments/fly-io/via-dockerfile.md +648 -0
- package/deployments/fly-io/via-flyctl.md +653 -0
- package/deployments/fly-io/via-github-actions.md +695 -0
- package/deployments/fly-io/via-multi-region.md +598 -0
- package/deployments/google/README.md +34 -0
- package/deployments/google/via-app-engine.md +42 -0
- package/deployments/google/via-cloud-functions.md +23 -0
- package/deployments/google/via-cloud-run.md +330 -0
- package/deployments/google/via-gke.md +23 -0
- package/deployments/netlify/README.md +99 -0
- package/deployments/netlify/via-cli.md +17 -0
- package/deployments/netlify/via-functions.md +19 -0
- package/deployments/netlify/via-git.md +25 -0
- package/deployments/vercel/README.md +90 -0
- package/deployments/vercel/via-api.md +16 -0
- package/deployments/vercel/via-cli.md +17 -0
- package/deployments/vercel/via-git.md +24 -0
- package/docs/BROWNFIELD.md +179 -0
- package/docs/getting-started.md +137 -0
- package/docs/good-agents-md.md +137 -0
- package/events/README.md +89 -0
- package/events/event-record.schema.json +26 -0
- package/events/registry.json +166 -0
- package/events/registry.schema.json +71 -0
- package/glossary.md +145 -0
- package/incidents/README.md +81 -0
- package/incidents/_template.md +38 -0
- package/interfaces/cli.md +104 -0
- package/interfaces/rest.md +212 -0
- package/interfaces/tui.md +242 -0
- package/interfaces/web.md +123 -0
- package/languages/6502-DASM.md +132 -0
- package/languages/c.md +235 -0
- package/languages/commands.md +23 -0
- package/languages/cpp.md +132 -0
- package/languages/csharp.md +259 -0
- package/languages/dart.md +183 -0
- package/languages/delphi.md +218 -0
- package/languages/elixir.md +208 -0
- package/languages/go.md +78 -0
- package/languages/java.md +278 -0
- package/languages/javascript.md +163 -0
- package/languages/julia.md +175 -0
- package/languages/kotlin.md +193 -0
- package/languages/markdown.md +168 -0
- package/languages/mermaid.md +146 -0
- package/languages/officejs.md +392 -0
- package/languages/python.md +209 -0
- package/languages/r.md +163 -0
- package/languages/rust.md +216 -0
- package/languages/sql.md +216 -0
- package/languages/swift.md +153 -0
- package/languages/typescript.md +132 -0
- package/languages/vba.md +279 -0
- package/languages/vhdl.md +180 -0
- package/languages/visual-basic.md +151 -0
- package/languages/zig.md +196 -0
- package/meta/SOUL.md +27 -0
- package/meta/code-field.md +44 -0
- package/meta/morals.md +40 -0
- package/meta/philosophy.md +39 -0
- package/meta/project.md +49 -0
- package/meta/ralph.md +223 -0
- package/meta/security.md +80 -0
- package/meta/versioning.md +326 -0
- package/package.json +22 -0
- package/packs/lessons/lessons-pack-0.1.json +553 -0
- package/packs/patterns/patterns-pack-0.1.json +57 -0
- package/packs/rules/rules-pack-0.1.json +4767 -0
- package/packs/skills/skills-pack-0.1.json +262 -0
- package/packs/strategies/strategies-pack-0.1.json +167 -0
- package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
- package/patterns/executor-layer-credentials.md +227 -0
- package/patterns/llm-app.md +156 -0
- package/patterns/multi-agent.md +278 -0
- package/patterns/prompt-assembly-layer-ordering.md +154 -0
- package/patterns/role-as-overlay.md +179 -0
- package/platforms/2600.md +137 -0
- package/platforms/unity.md +329 -0
- package/references/composer-skill-porting.md +152 -0
- package/references/cost-models.md +163 -0
- package/references/ip-risk.md +246 -0
- package/references/plain-english-ux.md +275 -0
- package/resilience/context-pruning.md +67 -0
- package/resilience/continue-here.md +62 -0
- package/scm/changelog.md +276 -0
- package/scm/git.md +139 -0
- package/scm/github.md +265 -0
- package/secrets/.gitkeep +0 -0
- package/skills/deft-build/SKILL.md +20 -0
- package/skills/deft-directive-article-review/SKILL.md +156 -0
- package/skills/deft-directive-build/SKILL.md +302 -0
- package/skills/deft-directive-cost/SKILL.md +201 -0
- package/skills/deft-directive-debug/SKILL.md +140 -0
- package/skills/deft-directive-decompose/SKILL.md +96 -0
- package/skills/deft-directive-gh-arch/SKILL.md +160 -0
- package/skills/deft-directive-gh-slice/SKILL.md +199 -0
- package/skills/deft-directive-glossary/SKILL.md +118 -0
- package/skills/deft-directive-interview/SKILL.md +528 -0
- package/skills/deft-directive-pre-pr/SKILL.md +131 -0
- package/skills/deft-directive-probe/SKILL.md +127 -0
- package/skills/deft-directive-refinement/SKILL.md +403 -0
- package/skills/deft-directive-release/SKILL.md +266 -0
- package/skills/deft-directive-review-cycle/SKILL.md +401 -0
- package/skills/deft-directive-setup/SKILL.md +717 -0
- package/skills/deft-directive-swarm/SKILL.md +989 -0
- package/skills/deft-directive-sync/SKILL.md +288 -0
- package/skills/deft-directive-triage/SKILL.md +137 -0
- package/skills/deft-directive-write-skill/SKILL.md +169 -0
- package/skills/deft-interview/SKILL.md +16 -0
- package/skills/deft-pre-pr/SKILL.md +16 -0
- package/skills/deft-review-cycle/SKILL.md +16 -0
- package/skills/deft-roadmap-refresh/SKILL.md +16 -0
- package/skills/deft-setup/SKILL.md +20 -0
- package/skills/deft-swarm/SKILL.md +16 -0
- package/skills/deft-sync/SKILL.md +16 -0
- package/strategies/README.md +83 -0
- package/strategies/artifact-guards.md +85 -0
- package/strategies/bdd.md +115 -0
- package/strategies/brownfield.md +7 -0
- package/strategies/discuss.md +129 -0
- package/strategies/emit-hints.md +69 -0
- package/strategies/enterprise.md +193 -0
- package/strategies/interview.md +551 -0
- package/strategies/map.md +179 -0
- package/strategies/probe.md +151 -0
- package/strategies/rapid.md +155 -0
- package/strategies/research.md +155 -0
- package/strategies/roadmap.md +9 -0
- package/strategies/speckit.md +437 -0
- package/strategies/v0-20-contract.md +134 -0
- package/strategies/yolo.md +169 -0
- package/swarm/swarm.md +300 -0
- package/templates/COST-ESTIMATE.md +114 -0
- package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
- package/templates/agent-prompt-preamble.md +409 -0
- package/templates/agents-entry.md +211 -0
- package/templates/agents-entry.placeholders.md +75 -0
- package/templates/embed.go +20 -0
- package/templates/embed_test.go +36 -0
- package/templates/make-spec-example.md +9 -0
- package/templates/make-spec.md +246 -0
- package/templates/project.md.template +52 -0
- package/templates/specification.md +1 -0
- package/templates/swarm-greptile-poller-prompt.md +556 -0
- package/templates/user.md.template +31 -0
- package/tools/RWLDL.md +80 -0
- package/tools/greptile.md +141 -0
- package/tools/installer.md +23 -0
- package/tools/taskfile-migration.md +32 -0
- package/tools/taskfile.md +185 -0
- package/tools/telemetry.md +285 -0
- package/vbrief/schemas/cache-meta.schema.json +137 -0
- package/vbrief/schemas/candidates.schema.json +130 -0
- package/vbrief/schemas/codebase-map.schema.json +213 -0
- package/vbrief/schemas/lessons-pack.schema.json +134 -0
- package/vbrief/schemas/patterns-pack.schema.json +84 -0
- package/vbrief/schemas/rules-pack.schema.json +105 -0
- package/vbrief/schemas/skills-pack.schema.json +94 -0
- package/vbrief/schemas/slices.schema.json +87 -0
- package/vbrief/schemas/strategies-pack.schema.json +89 -0
- package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
- package/vbrief/schemas/vbrief-core.schema.json +1022 -0
- package/vbrief/vbrief.md +684 -0
- package/verification/integration.md +76 -0
- package/verification/plan-checking.md +85 -0
- package/verification/uat.md +60 -0
- package/verification/verification.md +117 -0
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
# Deploy via Azure Container Apps
|
|
2
|
+
|
|
3
|
+
Deploy microservices and containerized applications using Azure Container Apps. Serverless containers with auto-scaling, KEDA integration, and Dapr support.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Azure Container Apps provides:
|
|
8
|
+
- **Serverless Containers**: Run containers without managing infrastructure
|
|
9
|
+
- **Auto-scaling**: Scale to zero, KEDA-based event-driven scaling
|
|
10
|
+
- **Dapr Integration**: Built-in microservices patterns
|
|
11
|
+
- **Revisions**: Blue-green and canary deployments
|
|
12
|
+
- **Ingress**: Automatic HTTPS and load balancing
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- Azure account with subscription
|
|
17
|
+
- Azure CLI with containerapp extension
|
|
18
|
+
- Container image in registry (ACR, Docker Hub, etc.)
|
|
19
|
+
- Resource group created
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### 1. Install Container Apps Extension
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install extension
|
|
27
|
+
az extension add --name containerapp --upgrade
|
|
28
|
+
|
|
29
|
+
# Verify
|
|
30
|
+
az containerapp --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Create Environment
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Create Log Analytics workspace
|
|
37
|
+
az monitor log-analytics workspace create \
|
|
38
|
+
--resource-group myapp-rg \
|
|
39
|
+
--workspace-name myapp-logs \
|
|
40
|
+
--location eastus
|
|
41
|
+
|
|
42
|
+
# Get workspace ID and key
|
|
43
|
+
WORKSPACE_ID=$(az monitor log-analytics workspace show \
|
|
44
|
+
--resource-group myapp-rg \
|
|
45
|
+
--workspace-name myapp-logs \
|
|
46
|
+
--query customerId -o tsv)
|
|
47
|
+
|
|
48
|
+
WORKSPACE_KEY=$(az monitor log-analytics workspace get-shared-keys \
|
|
49
|
+
--resource-group myapp-rg \
|
|
50
|
+
--workspace-name myapp-logs \
|
|
51
|
+
--query primarySharedKey -o tsv)
|
|
52
|
+
|
|
53
|
+
# Create Container Apps environment
|
|
54
|
+
az containerapp env create \
|
|
55
|
+
--name myapp-env \
|
|
56
|
+
--resource-group myapp-rg \
|
|
57
|
+
--location eastus \
|
|
58
|
+
--logs-workspace-id $WORKSPACE_ID \
|
|
59
|
+
--logs-workspace-key $WORKSPACE_KEY
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Deploy Container App
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Deploy from container image
|
|
66
|
+
az containerapp create \
|
|
67
|
+
--name myapp \
|
|
68
|
+
--resource-group myapp-rg \
|
|
69
|
+
--environment myapp-env \
|
|
70
|
+
--image myregistry.azurecr.io/myapp:latest \
|
|
71
|
+
--target-port 8080 \
|
|
72
|
+
--ingress external \
|
|
73
|
+
--min-replicas 0 \
|
|
74
|
+
--max-replicas 10
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Deployment from Different Sources
|
|
78
|
+
|
|
79
|
+
### From Azure Container Registry (ACR)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Create ACR
|
|
83
|
+
az acr create \
|
|
84
|
+
--name myregistry \
|
|
85
|
+
--resource-group myapp-rg \
|
|
86
|
+
--sku Basic
|
|
87
|
+
|
|
88
|
+
# Build and push image
|
|
89
|
+
az acr build \
|
|
90
|
+
--registry myregistry \
|
|
91
|
+
--image myapp:latest \
|
|
92
|
+
--file Dockerfile .
|
|
93
|
+
|
|
94
|
+
# Deploy with managed identity
|
|
95
|
+
az containerapp create \
|
|
96
|
+
--name myapp \
|
|
97
|
+
--resource-group myapp-rg \
|
|
98
|
+
--environment myapp-env \
|
|
99
|
+
--image myregistry.azurecr.io/myapp:latest \
|
|
100
|
+
--registry-server myregistry.azurecr.io \
|
|
101
|
+
--registry-identity system \
|
|
102
|
+
--target-port 8080 \
|
|
103
|
+
--ingress external
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### From Docker Hub
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
az containerapp create \
|
|
110
|
+
--name myapp \
|
|
111
|
+
--resource-group myapp-rg \
|
|
112
|
+
--environment myapp-env \
|
|
113
|
+
--image docker.io/library/nginx:latest \
|
|
114
|
+
--target-port 80 \
|
|
115
|
+
--ingress external
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### From Private Registry
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Store credentials in secret
|
|
122
|
+
az containerapp create \
|
|
123
|
+
--name myapp \
|
|
124
|
+
--resource-group myapp-rg \
|
|
125
|
+
--environment myapp-env \
|
|
126
|
+
--image myregistry.io/myapp:latest \
|
|
127
|
+
--registry-server myregistry.io \
|
|
128
|
+
--registry-username myuser \
|
|
129
|
+
--registry-password mypassword \
|
|
130
|
+
--target-port 8080 \
|
|
131
|
+
--ingress external
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Configuration
|
|
135
|
+
|
|
136
|
+
### Environment Variables
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Set environment variables
|
|
140
|
+
az containerapp update \
|
|
141
|
+
--name myapp \
|
|
142
|
+
--resource-group myapp-rg \
|
|
143
|
+
--set-env-vars \
|
|
144
|
+
APP_ENV=production \
|
|
145
|
+
LOG_LEVEL=info \
|
|
146
|
+
API_KEY=secretref:api-key
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Secrets
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Create secrets
|
|
153
|
+
az containerapp secret set \
|
|
154
|
+
--name myapp \
|
|
155
|
+
--resource-group myapp-rg \
|
|
156
|
+
--secrets \
|
|
157
|
+
api-key=my-secret-value \
|
|
158
|
+
db-password=my-db-password
|
|
159
|
+
|
|
160
|
+
# Use secrets in environment variables
|
|
161
|
+
az containerapp update \
|
|
162
|
+
--name myapp \
|
|
163
|
+
--resource-group myapp-rg \
|
|
164
|
+
--set-env-vars \
|
|
165
|
+
API_KEY=secretref:api-key \
|
|
166
|
+
DB_PASSWORD=secretref:db-password
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Resource Limits
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
az containerapp update \
|
|
173
|
+
--name myapp \
|
|
174
|
+
--resource-group myapp-rg \
|
|
175
|
+
--cpu 1.0 \
|
|
176
|
+
--memory 2.0Gi
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Ingress Configuration
|
|
180
|
+
|
|
181
|
+
### External Ingress (Public)
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
az containerapp ingress enable \
|
|
185
|
+
--name myapp \
|
|
186
|
+
--resource-group myapp-rg \
|
|
187
|
+
--type external \
|
|
188
|
+
--target-port 8080 \
|
|
189
|
+
--transport auto
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Internal Ingress (VNet)
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
az containerapp ingress enable \
|
|
196
|
+
--name myapp \
|
|
197
|
+
--resource-group myapp-rg \
|
|
198
|
+
--type internal \
|
|
199
|
+
--target-port 8080
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Custom Domain
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Add custom domain
|
|
206
|
+
az containerapp hostname add \
|
|
207
|
+
--name myapp \
|
|
208
|
+
--resource-group myapp-rg \
|
|
209
|
+
--hostname www.example.com
|
|
210
|
+
|
|
211
|
+
# Bind certificate
|
|
212
|
+
az containerapp hostname bind \
|
|
213
|
+
--name myapp \
|
|
214
|
+
--resource-group myapp-rg \
|
|
215
|
+
--hostname www.example.com \
|
|
216
|
+
--certificate cert-name \
|
|
217
|
+
--environment myapp-env
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Scaling
|
|
221
|
+
|
|
222
|
+
### Scale Rules
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# HTTP-based scaling
|
|
226
|
+
az containerapp update \
|
|
227
|
+
--name myapp \
|
|
228
|
+
--resource-group myapp-rg \
|
|
229
|
+
--min-replicas 1 \
|
|
230
|
+
--max-replicas 10 \
|
|
231
|
+
--scale-rule-name http-rule \
|
|
232
|
+
--scale-rule-type http \
|
|
233
|
+
--scale-rule-http-concurrency 100
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### KEDA Scaling
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Azure Queue scaling
|
|
240
|
+
az containerapp update \
|
|
241
|
+
--name myapp \
|
|
242
|
+
--resource-group myapp-rg \
|
|
243
|
+
--scale-rule-name queue-rule \
|
|
244
|
+
--scale-rule-type azure-queue \
|
|
245
|
+
--scale-rule-metadata \
|
|
246
|
+
queueName=myqueue \
|
|
247
|
+
queueLength=10 \
|
|
248
|
+
accountName=mystorageaccount \
|
|
249
|
+
--scale-rule-auth secretRef=queue-connection-string
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### CPU/Memory Scaling
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
az containerapp update \
|
|
256
|
+
--name myapp \
|
|
257
|
+
--resource-group myapp-rg \
|
|
258
|
+
--scale-rule-name cpu-rule \
|
|
259
|
+
--scale-rule-type cpu \
|
|
260
|
+
--scale-rule-metadata \
|
|
261
|
+
type=Utilization \
|
|
262
|
+
value=75
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Revisions and Traffic Splitting
|
|
266
|
+
|
|
267
|
+
### Create New Revision
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Update with new image (creates new revision)
|
|
271
|
+
az containerapp update \
|
|
272
|
+
--name myapp \
|
|
273
|
+
--resource-group myapp-rg \
|
|
274
|
+
--image myregistry.azurecr.io/myapp:v2
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Traffic Splitting (Blue-Green)
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Split traffic between revisions
|
|
281
|
+
az containerapp ingress traffic set \
|
|
282
|
+
--name myapp \
|
|
283
|
+
--resource-group myapp-rg \
|
|
284
|
+
--revision-weight \
|
|
285
|
+
myapp--rev1=80 \
|
|
286
|
+
myapp--rev2=20
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Single Revision Mode
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
# Ensure only one revision is active
|
|
293
|
+
az containerapp revision set-mode \
|
|
294
|
+
--name myapp \
|
|
295
|
+
--resource-group myapp-rg \
|
|
296
|
+
--mode single
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Multiple Revisions Mode
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# Allow multiple active revisions
|
|
303
|
+
az containerapp revision set-mode \
|
|
304
|
+
--name myapp \
|
|
305
|
+
--resource-group myapp-rg \
|
|
306
|
+
--mode multiple
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Dapr Integration
|
|
310
|
+
|
|
311
|
+
### Enable Dapr
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
az containerapp dapr enable \
|
|
315
|
+
--name myapp \
|
|
316
|
+
--resource-group myapp-rg \
|
|
317
|
+
--dapr-app-id myapp \
|
|
318
|
+
--dapr-app-port 8080 \
|
|
319
|
+
--dapr-app-protocol http
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Dapr Components
|
|
323
|
+
|
|
324
|
+
```yaml
|
|
325
|
+
# dapr-state-store.yaml
|
|
326
|
+
componentType: state.redis
|
|
327
|
+
version: v1
|
|
328
|
+
metadata:
|
|
329
|
+
- name: redisHost
|
|
330
|
+
value: myredis.redis.cache.windows.net:6380
|
|
331
|
+
- name: redisPassword
|
|
332
|
+
secretRef: redis-password
|
|
333
|
+
- name: enableTLS
|
|
334
|
+
value: true
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# Create Dapr component
|
|
339
|
+
az containerapp env dapr-component set \
|
|
340
|
+
--name myapp-env \
|
|
341
|
+
--resource-group myapp-rg \
|
|
342
|
+
--dapr-component-name statestore \
|
|
343
|
+
--yaml dapr-state-store.yaml
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Jobs (Scheduled/Event-Driven)
|
|
347
|
+
|
|
348
|
+
### Create Scheduled Job
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
az containerapp job create \
|
|
352
|
+
--name myjob \
|
|
353
|
+
--resource-group myapp-rg \
|
|
354
|
+
--environment myapp-env \
|
|
355
|
+
--trigger-type Schedule \
|
|
356
|
+
--cron-expression "0 */6 * * *" \
|
|
357
|
+
--image myregistry.azurecr.io/myjob:latest \
|
|
358
|
+
--cpu 0.5 \
|
|
359
|
+
--memory 1.0Gi \
|
|
360
|
+
--replica-timeout 600
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Manual Job Execution
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
az containerapp job start \
|
|
367
|
+
--name myjob \
|
|
368
|
+
--resource-group myapp-rg
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## CI/CD Integration
|
|
372
|
+
|
|
373
|
+
### GitHub Actions
|
|
374
|
+
|
|
375
|
+
```yaml
|
|
376
|
+
# .github/workflows/azure-container-apps.yml
|
|
377
|
+
name: Deploy to Azure Container Apps
|
|
378
|
+
|
|
379
|
+
on:
|
|
380
|
+
push:
|
|
381
|
+
branches: [main]
|
|
382
|
+
|
|
383
|
+
env:
|
|
384
|
+
AZURE_CONTAINER_APP: myapp
|
|
385
|
+
AZURE_RESOURCE_GROUP: myapp-rg
|
|
386
|
+
AZURE_CONTAINER_REGISTRY: myregistry
|
|
387
|
+
|
|
388
|
+
jobs:
|
|
389
|
+
build-and-deploy:
|
|
390
|
+
runs-on: ubuntu-latest
|
|
391
|
+
|
|
392
|
+
steps:
|
|
393
|
+
- uses: actions/checkout@v3
|
|
394
|
+
|
|
395
|
+
- uses: azure/login@v1
|
|
396
|
+
with:
|
|
397
|
+
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
|
398
|
+
|
|
399
|
+
- name: Build and push image
|
|
400
|
+
run: |
|
|
401
|
+
az acr build \
|
|
402
|
+
--registry ${{ env.AZURE_CONTAINER_REGISTRY }} \
|
|
403
|
+
--image ${{ env.AZURE_CONTAINER_APP }}:${{ github.sha }} \
|
|
404
|
+
--file Dockerfile .
|
|
405
|
+
|
|
406
|
+
- name: Deploy to Container Apps
|
|
407
|
+
uses: azure/container-apps-deploy-action@v1
|
|
408
|
+
with:
|
|
409
|
+
containerAppName: ${{ env.AZURE_CONTAINER_APP }}
|
|
410
|
+
resourceGroup: ${{ env.AZURE_RESOURCE_GROUP }}
|
|
411
|
+
imageToDeploy: ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.AZURE_CONTAINER_APP }}:${{ github.sha }}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Azure DevOps Pipeline
|
|
415
|
+
|
|
416
|
+
```yaml
|
|
417
|
+
# azure-pipelines.yml
|
|
418
|
+
trigger:
|
|
419
|
+
- main
|
|
420
|
+
|
|
421
|
+
pool:
|
|
422
|
+
vmImage: 'ubuntu-latest'
|
|
423
|
+
|
|
424
|
+
variables:
|
|
425
|
+
containerRegistry: 'myregistry.azurecr.io'
|
|
426
|
+
containerApp: 'myapp'
|
|
427
|
+
resourceGroup: 'myapp-rg'
|
|
428
|
+
|
|
429
|
+
stages:
|
|
430
|
+
- stage: Build
|
|
431
|
+
jobs:
|
|
432
|
+
- job: Build
|
|
433
|
+
steps:
|
|
434
|
+
- task: Docker@2
|
|
435
|
+
inputs:
|
|
436
|
+
containerRegistry: 'ACR-Connection'
|
|
437
|
+
repository: $(containerApp)
|
|
438
|
+
command: 'buildAndPush'
|
|
439
|
+
Dockerfile: '**/Dockerfile'
|
|
440
|
+
tags: |
|
|
441
|
+
$(Build.BuildId)
|
|
442
|
+
latest
|
|
443
|
+
|
|
444
|
+
- stage: Deploy
|
|
445
|
+
jobs:
|
|
446
|
+
- job: Deploy
|
|
447
|
+
steps:
|
|
448
|
+
- task: AzureCLI@2
|
|
449
|
+
inputs:
|
|
450
|
+
azureSubscription: 'Azure-Subscription'
|
|
451
|
+
scriptType: 'bash'
|
|
452
|
+
scriptLocation: 'inlineScript'
|
|
453
|
+
inlineScript: |
|
|
454
|
+
az containerapp update \
|
|
455
|
+
--name $(containerApp) \
|
|
456
|
+
--resource-group $(resourceGroup) \
|
|
457
|
+
--image $(containerRegistry)/$(containerApp):$(Build.BuildId)
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
## Monitoring & Logging
|
|
461
|
+
|
|
462
|
+
### View Logs
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
# Stream logs
|
|
466
|
+
az containerapp logs show \
|
|
467
|
+
--name myapp \
|
|
468
|
+
--resource-group myapp-rg \
|
|
469
|
+
--follow
|
|
470
|
+
|
|
471
|
+
# Get logs from specific revision
|
|
472
|
+
az containerapp logs show \
|
|
473
|
+
--name myapp \
|
|
474
|
+
--resource-group myapp-rg \
|
|
475
|
+
--revision myapp--rev1
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### Metrics
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
# View metrics
|
|
482
|
+
az monitor metrics list \
|
|
483
|
+
--resource /subscriptions/.../containerApps/myapp \
|
|
484
|
+
--metric-names "Requests,CpuUsage,MemoryUsage"
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Application Insights
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
# Enable Application Insights
|
|
491
|
+
az containerapp update \
|
|
492
|
+
--name myapp \
|
|
493
|
+
--resource-group myapp-rg \
|
|
494
|
+
--set-env-vars \
|
|
495
|
+
APPLICATIONINSIGHTS_CONNECTION_STRING="InstrumentationKey=..."
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## Networking
|
|
499
|
+
|
|
500
|
+
### VNet Integration
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
# Create VNet-integrated environment
|
|
504
|
+
az containerapp env create \
|
|
505
|
+
--name myapp-env \
|
|
506
|
+
--resource-group myapp-rg \
|
|
507
|
+
--location eastus \
|
|
508
|
+
--infrastructure-subnet-resource-id /subscriptions/.../subnets/containerapp-subnet \
|
|
509
|
+
--internal-only
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Service-to-Service Communication
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
# Access another container app internally
|
|
516
|
+
# Use format: http://myapp.internal.{environment-domain}
|
|
517
|
+
|
|
518
|
+
# Get internal FQDN
|
|
519
|
+
az containerapp show \
|
|
520
|
+
--name myapp \
|
|
521
|
+
--resource-group myapp-rg \
|
|
522
|
+
--query properties.configuration.ingress.fqdn -o tsv
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
## Best Practices
|
|
526
|
+
|
|
527
|
+
1. **Use Managed Identity**: Avoid storing credentials for ACR
|
|
528
|
+
2. **Enable Dapr**: For microservices patterns (state, pub/sub, bindings)
|
|
529
|
+
3. **Scale to Zero**: Save costs for non-critical workloads
|
|
530
|
+
4. **Use Revisions**: Test changes with traffic splitting
|
|
531
|
+
5. **Monitor with App Insights**: Track performance and errors
|
|
532
|
+
6. **VNet Integration**: For private workloads
|
|
533
|
+
7. **KEDA Scaling**: Use event-driven scaling for efficient resource usage
|
|
534
|
+
8. **Secrets Management**: Store secrets in Container Apps, not environment variables
|
|
535
|
+
9. **Health Probes**: Configure liveness and readiness probes
|
|
536
|
+
10. **Resource Limits**: Set appropriate CPU/memory limits
|
|
537
|
+
|
|
538
|
+
## Comparison with Other Services
|
|
539
|
+
|
|
540
|
+
| Feature | Container Apps | App Service | AKS |
|
|
541
|
+
|---------|---------------|-------------|-----|
|
|
542
|
+
| Complexity | Low | Low | High |
|
|
543
|
+
| Kubernetes | Managed | No | Full control |
|
|
544
|
+
| Scale to Zero | Yes | No | Manual |
|
|
545
|
+
| Dapr | Built-in | No | Manual |
|
|
546
|
+
| Price | Pay per use | Always on | Node-based |
|
|
547
|
+
|
|
548
|
+
## Troubleshooting
|
|
549
|
+
|
|
550
|
+
### Container Won't Start
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
# Check revision status
|
|
554
|
+
az containerapp revision list \
|
|
555
|
+
--name myapp \
|
|
556
|
+
--resource-group myapp-rg
|
|
557
|
+
|
|
558
|
+
# View system logs
|
|
559
|
+
az containerapp logs show \
|
|
560
|
+
--name myapp \
|
|
561
|
+
--resource-group myapp-rg \
|
|
562
|
+
--type system
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### Scaling Issues
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
# Check replica count
|
|
569
|
+
az containerapp replica list \
|
|
570
|
+
--name myapp \
|
|
571
|
+
--resource-group myapp-rg \
|
|
572
|
+
--revision myapp--rev1
|
|
573
|
+
|
|
574
|
+
# Review scale rules
|
|
575
|
+
az containerapp show \
|
|
576
|
+
--name myapp \
|
|
577
|
+
--resource-group myapp-rg \
|
|
578
|
+
--query properties.template.scale
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
## Cost Optimization
|
|
582
|
+
|
|
583
|
+
```bash
|
|
584
|
+
# Scale to zero for dev/test
|
|
585
|
+
--min-replicas 0 --max-replicas 10
|
|
586
|
+
|
|
587
|
+
# Right-size resources
|
|
588
|
+
--cpu 0.5 --memory 1.0Gi
|
|
589
|
+
|
|
590
|
+
# Use consumption plan (default)
|
|
591
|
+
# Monitor and optimize scale rules
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
## References
|
|
595
|
+
|
|
596
|
+
- [Azure Container Apps Documentation](https://docs.microsoft.com/azure/container-apps/)
|
|
597
|
+
- [KEDA Scalers](https://keda.sh/docs/scalers/)
|
|
598
|
+
- [Dapr Documentation](https://docs.dapr.io/)
|
|
599
|
+
- [Container Apps Pricing](https://azure.microsoft.com/pricing/details/container-apps/)
|