@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.
Files changed (250) hide show
  1. package/.agents/skills/deft/SKILL.md +6 -0
  2. package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
  3. package/.agents/skills/deft-directive-build/SKILL.md +10 -0
  4. package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
  5. package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
  6. package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
  7. package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
  8. package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
  9. package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
  10. package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
  11. package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
  12. package/.agents/skills/deft-directive-release/SKILL.md +12 -0
  13. package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
  14. package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
  15. package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
  16. package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
  17. package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
  18. package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
  19. package/LICENSE.md +22 -0
  20. package/QUICK-START.md +167 -0
  21. package/UPGRADING.md +517 -0
  22. package/coding/build-output.md +28 -0
  23. package/coding/coding.md +235 -0
  24. package/coding/debugging.md +110 -0
  25. package/coding/holzmann.md +96 -0
  26. package/coding/hygiene.md +127 -0
  27. package/coding/security.md +158 -0
  28. package/coding/testing.md +162 -0
  29. package/coding/toolchain.md +44 -0
  30. package/commands.md +300 -0
  31. package/context/context.md +57 -0
  32. package/context/deterministic-split.md +67 -0
  33. package/context/examples.md +26 -0
  34. package/context/fractal-summaries.md +69 -0
  35. package/context/long-horizon.md +46 -0
  36. package/context/spec-deltas.md +177 -0
  37. package/context/tool-design.md +34 -0
  38. package/context/working-memory.md +62 -0
  39. package/contracts/boundary-maps.md +65 -0
  40. package/contracts/deterministic-questions.md +59 -0
  41. package/contracts/hierarchy.md +77 -0
  42. package/conventions/content-manifest.json +399 -0
  43. package/conventions/machine-generated-banner.md +130 -0
  44. package/conventions/references.md +120 -0
  45. package/conventions/rule-ownership.json +382 -0
  46. package/conventions/task-caching.md +43 -0
  47. package/conventions/vbrief-filenames.md +70 -0
  48. package/deployments/README.md +37 -0
  49. package/deployments/agentuity/README.md +138 -0
  50. package/deployments/agentuity/via-cli.md +380 -0
  51. package/deployments/agentuity/via-cloud.md +425 -0
  52. package/deployments/agentuity/via-github-actions.md +664 -0
  53. package/deployments/agentuity/via-gravity-network.md +606 -0
  54. package/deployments/agentuity/via-vpc.md +607 -0
  55. package/deployments/aws/README.md +38 -0
  56. package/deployments/aws/via-app-runner.md +612 -0
  57. package/deployments/aws/via-ecs-fargate.md +561 -0
  58. package/deployments/aws/via-elastic-beanstalk.md +628 -0
  59. package/deployments/aws/via-lambda.md +649 -0
  60. package/deployments/azure/README.md +37 -0
  61. package/deployments/azure/via-aks.md +390 -0
  62. package/deployments/azure/via-app-service.md +564 -0
  63. package/deployments/azure/via-container-apps.md +599 -0
  64. package/deployments/azure/via-functions.md +552 -0
  65. package/deployments/cloud-gov/README.md +63 -0
  66. package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
  67. package/deployments/cloud-gov/agents.md +39 -0
  68. package/deployments/cloud-gov/cicd.md +64 -0
  69. package/deployments/cloud-gov/deployment.md +150 -0
  70. package/deployments/cloud-gov/logging.md +43 -0
  71. package/deployments/cloud-gov/manifest.md +121 -0
  72. package/deployments/cloud-gov/overview.md +58 -0
  73. package/deployments/cloud-gov/security.md +46 -0
  74. package/deployments/cloud-gov/services.md +72 -0
  75. package/deployments/cloud-gov/upstream/README.md +18 -0
  76. package/deployments/cloudflare/README.md +33 -0
  77. package/deployments/cloudflare/via-dashboard.md +83 -0
  78. package/deployments/cloudflare/via-git.md +90 -0
  79. package/deployments/cloudflare/via-github-actions.md +185 -0
  80. package/deployments/cloudflare/via-terraform.md +157 -0
  81. package/deployments/cloudflare/via-wrangler.md +165 -0
  82. package/deployments/fly-io/README.md +37 -0
  83. package/deployments/fly-io/via-dockerfile.md +648 -0
  84. package/deployments/fly-io/via-flyctl.md +653 -0
  85. package/deployments/fly-io/via-github-actions.md +695 -0
  86. package/deployments/fly-io/via-multi-region.md +598 -0
  87. package/deployments/google/README.md +34 -0
  88. package/deployments/google/via-app-engine.md +42 -0
  89. package/deployments/google/via-cloud-functions.md +23 -0
  90. package/deployments/google/via-cloud-run.md +330 -0
  91. package/deployments/google/via-gke.md +23 -0
  92. package/deployments/netlify/README.md +99 -0
  93. package/deployments/netlify/via-cli.md +17 -0
  94. package/deployments/netlify/via-functions.md +19 -0
  95. package/deployments/netlify/via-git.md +25 -0
  96. package/deployments/vercel/README.md +90 -0
  97. package/deployments/vercel/via-api.md +16 -0
  98. package/deployments/vercel/via-cli.md +17 -0
  99. package/deployments/vercel/via-git.md +24 -0
  100. package/docs/BROWNFIELD.md +179 -0
  101. package/docs/getting-started.md +137 -0
  102. package/docs/good-agents-md.md +137 -0
  103. package/events/README.md +89 -0
  104. package/events/event-record.schema.json +26 -0
  105. package/events/registry.json +166 -0
  106. package/events/registry.schema.json +71 -0
  107. package/glossary.md +145 -0
  108. package/incidents/README.md +81 -0
  109. package/incidents/_template.md +38 -0
  110. package/interfaces/cli.md +104 -0
  111. package/interfaces/rest.md +212 -0
  112. package/interfaces/tui.md +242 -0
  113. package/interfaces/web.md +123 -0
  114. package/languages/6502-DASM.md +132 -0
  115. package/languages/c.md +235 -0
  116. package/languages/commands.md +23 -0
  117. package/languages/cpp.md +132 -0
  118. package/languages/csharp.md +259 -0
  119. package/languages/dart.md +183 -0
  120. package/languages/delphi.md +218 -0
  121. package/languages/elixir.md +208 -0
  122. package/languages/go.md +78 -0
  123. package/languages/java.md +278 -0
  124. package/languages/javascript.md +163 -0
  125. package/languages/julia.md +175 -0
  126. package/languages/kotlin.md +193 -0
  127. package/languages/markdown.md +168 -0
  128. package/languages/mermaid.md +146 -0
  129. package/languages/officejs.md +392 -0
  130. package/languages/python.md +209 -0
  131. package/languages/r.md +163 -0
  132. package/languages/rust.md +216 -0
  133. package/languages/sql.md +216 -0
  134. package/languages/swift.md +153 -0
  135. package/languages/typescript.md +132 -0
  136. package/languages/vba.md +279 -0
  137. package/languages/vhdl.md +180 -0
  138. package/languages/visual-basic.md +151 -0
  139. package/languages/zig.md +196 -0
  140. package/meta/SOUL.md +27 -0
  141. package/meta/code-field.md +44 -0
  142. package/meta/morals.md +40 -0
  143. package/meta/philosophy.md +39 -0
  144. package/meta/project.md +49 -0
  145. package/meta/ralph.md +223 -0
  146. package/meta/security.md +80 -0
  147. package/meta/versioning.md +326 -0
  148. package/package.json +22 -0
  149. package/packs/lessons/lessons-pack-0.1.json +553 -0
  150. package/packs/patterns/patterns-pack-0.1.json +57 -0
  151. package/packs/rules/rules-pack-0.1.json +4767 -0
  152. package/packs/skills/skills-pack-0.1.json +262 -0
  153. package/packs/strategies/strategies-pack-0.1.json +167 -0
  154. package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
  155. package/patterns/executor-layer-credentials.md +227 -0
  156. package/patterns/llm-app.md +156 -0
  157. package/patterns/multi-agent.md +278 -0
  158. package/patterns/prompt-assembly-layer-ordering.md +154 -0
  159. package/patterns/role-as-overlay.md +179 -0
  160. package/platforms/2600.md +137 -0
  161. package/platforms/unity.md +329 -0
  162. package/references/composer-skill-porting.md +152 -0
  163. package/references/cost-models.md +163 -0
  164. package/references/ip-risk.md +246 -0
  165. package/references/plain-english-ux.md +275 -0
  166. package/resilience/context-pruning.md +67 -0
  167. package/resilience/continue-here.md +62 -0
  168. package/scm/changelog.md +276 -0
  169. package/scm/git.md +139 -0
  170. package/scm/github.md +265 -0
  171. package/secrets/.gitkeep +0 -0
  172. package/skills/deft-build/SKILL.md +20 -0
  173. package/skills/deft-directive-article-review/SKILL.md +156 -0
  174. package/skills/deft-directive-build/SKILL.md +302 -0
  175. package/skills/deft-directive-cost/SKILL.md +201 -0
  176. package/skills/deft-directive-debug/SKILL.md +140 -0
  177. package/skills/deft-directive-decompose/SKILL.md +96 -0
  178. package/skills/deft-directive-gh-arch/SKILL.md +160 -0
  179. package/skills/deft-directive-gh-slice/SKILL.md +199 -0
  180. package/skills/deft-directive-glossary/SKILL.md +118 -0
  181. package/skills/deft-directive-interview/SKILL.md +528 -0
  182. package/skills/deft-directive-pre-pr/SKILL.md +131 -0
  183. package/skills/deft-directive-probe/SKILL.md +127 -0
  184. package/skills/deft-directive-refinement/SKILL.md +403 -0
  185. package/skills/deft-directive-release/SKILL.md +266 -0
  186. package/skills/deft-directive-review-cycle/SKILL.md +401 -0
  187. package/skills/deft-directive-setup/SKILL.md +717 -0
  188. package/skills/deft-directive-swarm/SKILL.md +989 -0
  189. package/skills/deft-directive-sync/SKILL.md +288 -0
  190. package/skills/deft-directive-triage/SKILL.md +137 -0
  191. package/skills/deft-directive-write-skill/SKILL.md +169 -0
  192. package/skills/deft-interview/SKILL.md +16 -0
  193. package/skills/deft-pre-pr/SKILL.md +16 -0
  194. package/skills/deft-review-cycle/SKILL.md +16 -0
  195. package/skills/deft-roadmap-refresh/SKILL.md +16 -0
  196. package/skills/deft-setup/SKILL.md +20 -0
  197. package/skills/deft-swarm/SKILL.md +16 -0
  198. package/skills/deft-sync/SKILL.md +16 -0
  199. package/strategies/README.md +83 -0
  200. package/strategies/artifact-guards.md +85 -0
  201. package/strategies/bdd.md +115 -0
  202. package/strategies/brownfield.md +7 -0
  203. package/strategies/discuss.md +129 -0
  204. package/strategies/emit-hints.md +69 -0
  205. package/strategies/enterprise.md +193 -0
  206. package/strategies/interview.md +551 -0
  207. package/strategies/map.md +179 -0
  208. package/strategies/probe.md +151 -0
  209. package/strategies/rapid.md +155 -0
  210. package/strategies/research.md +155 -0
  211. package/strategies/roadmap.md +9 -0
  212. package/strategies/speckit.md +437 -0
  213. package/strategies/v0-20-contract.md +134 -0
  214. package/strategies/yolo.md +169 -0
  215. package/swarm/swarm.md +300 -0
  216. package/templates/COST-ESTIMATE.md +114 -0
  217. package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
  218. package/templates/agent-prompt-preamble.md +409 -0
  219. package/templates/agents-entry.md +211 -0
  220. package/templates/agents-entry.placeholders.md +75 -0
  221. package/templates/embed.go +20 -0
  222. package/templates/embed_test.go +36 -0
  223. package/templates/make-spec-example.md +9 -0
  224. package/templates/make-spec.md +246 -0
  225. package/templates/project.md.template +52 -0
  226. package/templates/specification.md +1 -0
  227. package/templates/swarm-greptile-poller-prompt.md +556 -0
  228. package/templates/user.md.template +31 -0
  229. package/tools/RWLDL.md +80 -0
  230. package/tools/greptile.md +141 -0
  231. package/tools/installer.md +23 -0
  232. package/tools/taskfile-migration.md +32 -0
  233. package/tools/taskfile.md +185 -0
  234. package/tools/telemetry.md +285 -0
  235. package/vbrief/schemas/cache-meta.schema.json +137 -0
  236. package/vbrief/schemas/candidates.schema.json +130 -0
  237. package/vbrief/schemas/codebase-map.schema.json +213 -0
  238. package/vbrief/schemas/lessons-pack.schema.json +134 -0
  239. package/vbrief/schemas/patterns-pack.schema.json +84 -0
  240. package/vbrief/schemas/rules-pack.schema.json +105 -0
  241. package/vbrief/schemas/skills-pack.schema.json +94 -0
  242. package/vbrief/schemas/slices.schema.json +87 -0
  243. package/vbrief/schemas/strategies-pack.schema.json +89 -0
  244. package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
  245. package/vbrief/schemas/vbrief-core.schema.json +1022 -0
  246. package/vbrief/vbrief.md +684 -0
  247. package/verification/integration.md +76 -0
  248. package/verification/plan-checking.md +85 -0
  249. package/verification/uat.md +60 -0
  250. package/verification/verification.md +117 -0
@@ -0,0 +1,564 @@
1
+ # Deploy via Azure App Service
2
+
3
+ Deploy web applications using Azure App Service, a fully managed Platform-as-a-Service (PaaS) for building, deploying, and scaling web apps.
4
+
5
+ ## Overview
6
+
7
+ Azure App Service provides managed hosting:
8
+ - **Multi-Language Support**: .NET, Node.js, Python, Java, PHP, Ruby
9
+ - **Built-in CI/CD**: GitHub, Azure DevOps, Bitbucket integration
10
+ - **Auto-scaling**: Scale up/out automatically
11
+ - **Custom Domains & SSL**: Free SSL certificates
12
+ - **Deployment Slots**: Blue-green deployments built-in
13
+
14
+ ## Prerequisites
15
+
16
+ - Azure account with subscription
17
+ - Azure CLI installed
18
+ - Application code
19
+ - Resource group created
20
+
21
+ ## Quick Start
22
+
23
+ ### 1. Install Azure CLI
24
+
25
+ ```bash
26
+ # macOS
27
+ brew install azure-cli
28
+
29
+ # Or via installer
30
+ curl -L https://aka.ms/InstallAzureCli | bash
31
+
32
+ # Verify
33
+ az --version
34
+ ```
35
+
36
+ ### 2. Login and Create Resource Group
37
+
38
+ ```bash
39
+ # Login
40
+ az login
41
+
42
+ # Create resource group
43
+ az group create --name myapp-rg --location eastus
44
+ ```
45
+
46
+ ### 3. Deploy Application
47
+
48
+ ```bash
49
+ # Deploy from local directory (auto-detects runtime)
50
+ az webapp up \
51
+ --name myapp \
52
+ --resource-group myapp-rg \
53
+ --runtime "NODE:18-lts"
54
+
55
+ # Or create and deploy separately
56
+ az appservice plan create \
57
+ --name myapp-plan \
58
+ --resource-group myapp-rg \
59
+ --sku B1 \
60
+ --is-linux
61
+
62
+ az webapp create \
63
+ --name myapp \
64
+ --resource-group myapp-rg \
65
+ --plan myapp-plan \
66
+ --runtime "NODE|18-lts"
67
+
68
+ # Deploy code
69
+ az webapp deploy \
70
+ --name myapp \
71
+ --resource-group myapp-rg \
72
+ --src-path app.zip
73
+ ```
74
+
75
+ ## Runtime-Specific Deployments
76
+
77
+ ### Node.js Application
78
+
79
+ ```bash
80
+ # Create App Service
81
+ az webapp create \
82
+ --name myapp \
83
+ --resource-group myapp-rg \
84
+ --plan myapp-plan \
85
+ --runtime "NODE|18-lts"
86
+
87
+ # Configure startup command
88
+ az webapp config set \
89
+ --name myapp \
90
+ --resource-group myapp-rg \
91
+ --startup-file "npm start"
92
+
93
+ # Deploy via ZIP
94
+ zip -r app.zip .
95
+ az webapp deploy \
96
+ --name myapp \
97
+ --resource-group myapp-rg \
98
+ --src-path app.zip
99
+ ```
100
+
101
+ ### Python Application
102
+
103
+ ```bash
104
+ # Create App Service
105
+ az webapp create \
106
+ --name myapp \
107
+ --resource-group myapp-rg \
108
+ --plan myapp-plan \
109
+ --runtime "PYTHON|3.11"
110
+
111
+ # Configure startup command
112
+ az webapp config set \
113
+ --name myapp \
114
+ --resource-group myapp-rg \
115
+ --startup-file "gunicorn --bind=0.0.0.0 --timeout 600 app:app"
116
+
117
+ # Deploy
118
+ az webapp deploy \
119
+ --name myapp \
120
+ --resource-group myapp-rg \
121
+ --src-path app.zip
122
+ ```
123
+
124
+ ### .NET Application
125
+
126
+ ```bash
127
+ # Create App Service (Windows)
128
+ az webapp create \
129
+ --name myapp \
130
+ --resource-group myapp-rg \
131
+ --plan myapp-plan \
132
+ --runtime "DOTNET|7.0"
133
+
134
+ # Deploy
135
+ dotnet publish -c Release
136
+ cd bin/Release/net7.0/publish
137
+ zip -r ../../../app.zip .
138
+ cd ../../..
139
+
140
+ az webapp deploy \
141
+ --name myapp \
142
+ --resource-group myapp-rg \
143
+ --src-path app.zip
144
+ ```
145
+
146
+ ### Java Application
147
+
148
+ ```bash
149
+ # Create App Service
150
+ az webapp create \
151
+ --name myapp \
152
+ --resource-group myapp-rg \
153
+ --plan myapp-plan \
154
+ --runtime "JAVA|17-java17"
155
+
156
+ # Deploy JAR
157
+ mvn clean package
158
+ az webapp deploy \
159
+ --name myapp \
160
+ --resource-group myapp-rg \
161
+ --src-path target/app.jar \
162
+ --type jar
163
+ ```
164
+
165
+ ### Docker Container
166
+
167
+ ```bash
168
+ # Create App Service for containers
169
+ az webapp create \
170
+ --name myapp \
171
+ --resource-group myapp-rg \
172
+ --plan myapp-plan \
173
+ --deployment-container-image-name myregistry.azurecr.io/myapp:latest
174
+
175
+ # Enable continuous deployment
176
+ az webapp deployment container config \
177
+ --name myapp \
178
+ --resource-group myapp-rg \
179
+ --enable-cd true
180
+ ```
181
+
182
+ ## Configuration
183
+
184
+ ### Environment Variables
185
+
186
+ ```bash
187
+ # Set app settings (environment variables)
188
+ az webapp config appsettings set \
189
+ --name myapp \
190
+ --resource-group myapp-rg \
191
+ --settings \
192
+ APP_ENV=production \
193
+ DATABASE_URL="@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/db-url/)"
194
+ ```
195
+
196
+ ### Connection Strings
197
+
198
+ ```bash
199
+ # Add connection string
200
+ az webapp config connection-string set \
201
+ --name myapp \
202
+ --resource-group myapp-rg \
203
+ --connection-string-type SQLAzure \
204
+ --settings \
205
+ DefaultConnection="Server=tcp:myserver.database.windows.net..."
206
+ ```
207
+
208
+ ### Custom Domain & SSL
209
+
210
+ ```bash
211
+ # Add custom domain
212
+ az webapp config hostname add \
213
+ --webapp-name myapp \
214
+ --resource-group myapp-rg \
215
+ --hostname www.example.com
216
+
217
+ # Bind SSL certificate
218
+ az webapp config ssl bind \
219
+ --name myapp \
220
+ --resource-group myapp-rg \
221
+ --certificate-thumbprint THUMBPRINT \
222
+ --ssl-type SNI
223
+ ```
224
+
225
+ ## Deployment Methods
226
+
227
+ ### Git Deployment
228
+
229
+ ```bash
230
+ # Enable local Git deployment
231
+ az webapp deployment source config-local-git \
232
+ --name myapp \
233
+ --resource-group myapp-rg
234
+
235
+ # Get Git URL
236
+ az webapp deployment list-publishing-credentials \
237
+ --name myapp \
238
+ --resource-group myapp-rg
239
+
240
+ # Deploy via Git
241
+ git remote add azure <git-url>
242
+ git push azure main
243
+ ```
244
+
245
+ ### GitHub Actions Deployment
246
+
247
+ ```bash
248
+ # Configure GitHub deployment
249
+ az webapp deployment github-actions add \
250
+ --name myapp \
251
+ --resource-group myapp-rg \
252
+ --repo "username/repo" \
253
+ --branch main \
254
+ --runtime-stack node \
255
+ --runtime-version 18.x
256
+ ```
257
+
258
+ ```yaml
259
+ # .github/workflows/azure-webapps-node.yml
260
+ name: Deploy to Azure App Service
261
+
262
+ on:
263
+ push:
264
+ branches: [main]
265
+
266
+ jobs:
267
+ deploy:
268
+ runs-on: ubuntu-latest
269
+
270
+ steps:
271
+ - uses: actions/checkout@v3
272
+
273
+ - uses: actions/setup-node@v3
274
+ with:
275
+ node-version: '18'
276
+
277
+ - name: Install dependencies
278
+ run: npm ci
279
+
280
+ - name: Build
281
+ run: npm run build --if-present
282
+
283
+ - uses: azure/webapps-deploy@v2
284
+ with:
285
+ app-name: myapp
286
+ publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
287
+ package: .
288
+ ```
289
+
290
+ ### Azure DevOps Pipeline
291
+
292
+ ```yaml
293
+ # azure-pipelines.yml
294
+ trigger:
295
+ - main
296
+
297
+ pool:
298
+ vmImage: 'ubuntu-latest'
299
+
300
+ variables:
301
+ azureSubscription: 'My-Azure-Subscription'
302
+ webAppName: 'myapp'
303
+
304
+ stages:
305
+ - stage: Build
306
+ jobs:
307
+ - job: Build
308
+ steps:
309
+ - task: NodeTool@0
310
+ inputs:
311
+ versionSpec: '18.x'
312
+
313
+ - script: npm ci
314
+ displayName: 'Install dependencies'
315
+
316
+ - script: npm run build
317
+ displayName: 'Build application'
318
+
319
+ - task: ArchiveFiles@2
320
+ inputs:
321
+ rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
322
+ includeRootFolder: false
323
+ archiveType: 'zip'
324
+ archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
325
+
326
+ - publish: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
327
+ artifact: drop
328
+
329
+ - stage: Deploy
330
+ dependsOn: Build
331
+ jobs:
332
+ - deployment: Deploy
333
+ environment: 'production'
334
+ strategy:
335
+ runOnce:
336
+ deploy:
337
+ steps:
338
+ - task: AzureWebApp@1
339
+ inputs:
340
+ azureSubscription: '$(azureSubscription)'
341
+ appName: '$(webAppName)'
342
+ package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
343
+ ```
344
+
345
+ ## Deployment Slots
346
+
347
+ ### Create Staging Slot
348
+
349
+ ```bash
350
+ # Create deployment slot
351
+ az webapp deployment slot create \
352
+ --name myapp \
353
+ --resource-group myapp-rg \
354
+ --slot staging
355
+
356
+ # Deploy to staging
357
+ az webapp deployment source config \
358
+ --name myapp \
359
+ --resource-group myapp-rg \
360
+ --slot staging \
361
+ --repo-url https://github.com/user/repo \
362
+ --branch develop
363
+
364
+ # Swap slots (blue-green deployment)
365
+ az webapp deployment slot swap \
366
+ --name myapp \
367
+ --resource-group myapp-rg \
368
+ --slot staging \
369
+ --target-slot production
370
+ ```
371
+
372
+ ## Auto-scaling
373
+
374
+ ### Scale Up (Vertical)
375
+
376
+ ```bash
377
+ # Change pricing tier
378
+ az appservice plan update \
379
+ --name myapp-plan \
380
+ --resource-group myapp-rg \
381
+ --sku P1V2
382
+ ```
383
+
384
+ ### Scale Out (Horizontal)
385
+
386
+ ```bash
387
+ # Set instance count
388
+ az appservice plan update \
389
+ --name myapp-plan \
390
+ --resource-group myapp-rg \
391
+ --number-of-workers 3
392
+
393
+ # Configure auto-scale rules
394
+ az monitor autoscale create \
395
+ --resource-group myapp-rg \
396
+ --resource myapp-plan \
397
+ --resource-type Microsoft.Web/serverfarms \
398
+ --name myapp-autoscale \
399
+ --min-count 1 \
400
+ --max-count 10 \
401
+ --count 2
402
+
403
+ # CPU-based scaling
404
+ az monitor autoscale rule create \
405
+ --resource-group myapp-rg \
406
+ --autoscale-name myapp-autoscale \
407
+ --condition "Percentage CPU > 75 avg 5m" \
408
+ --scale out 2
409
+
410
+ az monitor autoscale rule create \
411
+ --resource-group myapp-rg \
412
+ --autoscale-name myapp-autoscale \
413
+ --condition "Percentage CPU < 25 avg 5m" \
414
+ --scale in 1
415
+ ```
416
+
417
+ ## Monitoring & Logging
418
+
419
+ ### Enable Application Insights
420
+
421
+ ```bash
422
+ # Create Application Insights
423
+ az monitor app-insights component create \
424
+ --app myapp-insights \
425
+ --location eastus \
426
+ --resource-group myapp-rg
427
+
428
+ # Link to App Service
429
+ az webapp config appsettings set \
430
+ --name myapp \
431
+ --resource-group myapp-rg \
432
+ --settings \
433
+ APPINSIGHTS_INSTRUMENTATIONKEY="<key>"
434
+ ```
435
+
436
+ ### View Logs
437
+
438
+ ```bash
439
+ # Stream logs
440
+ az webapp log tail \
441
+ --name myapp \
442
+ --resource-group myapp-rg
443
+
444
+ # Download logs
445
+ az webapp log download \
446
+ --name myapp \
447
+ --resource-group myapp-rg \
448
+ --log-file logs.zip
449
+ ```
450
+
451
+ ## Database Integration
452
+
453
+ ### Azure SQL Database
454
+
455
+ ```bash
456
+ # Create SQL Server and database
457
+ az sql server create \
458
+ --name myserver \
459
+ --resource-group myapp-rg \
460
+ --location eastus \
461
+ --admin-user sqladmin \
462
+ --admin-password <password>
463
+
464
+ az sql db create \
465
+ --name mydb \
466
+ --server myserver \
467
+ --resource-group myapp-rg \
468
+ --service-objective S0
469
+
470
+ # Add connection string to app
471
+ az webapp config connection-string set \
472
+ --name myapp \
473
+ --resource-group myapp-rg \
474
+ --connection-string-type SQLAzure \
475
+ --settings \
476
+ DefaultConnection="Server=tcp:myserver.database.windows.net..."
477
+ ```
478
+
479
+ ### Azure Cosmos DB
480
+
481
+ ```bash
482
+ # Create Cosmos DB account
483
+ az cosmosdb create \
484
+ --name mycosmosdb \
485
+ --resource-group myapp-rg
486
+
487
+ # Get connection string
488
+ az cosmosdb keys list \
489
+ --name mycosmosdb \
490
+ --resource-group myapp-rg \
491
+ --type connection-strings
492
+
493
+ # Add to app settings
494
+ az webapp config appsettings set \
495
+ --name myapp \
496
+ --resource-group myapp-rg \
497
+ --settings \
498
+ COSMOS_DB_CONNECTION="<connection-string>"
499
+ ```
500
+
501
+ ## Best Practices
502
+
503
+ 1. **Use Deployment Slots**: Test changes in staging before production
504
+ 2. **Enable Application Insights**: Monitor performance and errors
505
+ 3. **Use Managed Identity**: Avoid storing credentials
506
+ 4. **Configure Auto-scaling**: Handle traffic spikes automatically
507
+ 5. **Use Key Vault**: Store secrets securely
508
+ 6. **Enable Always On**: Keep app warm (paid tiers only)
509
+ 7. **Configure Health Checks**: Ensure automatic recovery
510
+ 8. **Use CDN**: Serve static assets from edge locations
511
+ 9. **Enable Diagnostic Logs**: Troubleshoot issues efficiently
512
+ 10. **Tag Resources**: Organize and track costs
513
+
514
+ ## Troubleshooting
515
+
516
+ ### Application Won't Start
517
+
518
+ ```bash
519
+ # Check logs
520
+ az webapp log tail \
521
+ --name myapp \
522
+ --resource-group myapp-rg
523
+
524
+ # Check configuration
525
+ az webapp config show \
526
+ --name myapp \
527
+ --resource-group myapp-rg
528
+ ```
529
+
530
+ ### Performance Issues
531
+
532
+ ```bash
533
+ # Check metrics
534
+ az monitor metrics list \
535
+ --resource /subscriptions/.../providers/Microsoft.Web/sites/myapp \
536
+ --metric-names "CpuPercentage,MemoryPercentage,HttpResponseTime"
537
+
538
+ # Scale up if needed
539
+ az appservice plan update \
540
+ --name myapp-plan \
541
+ --resource-group myapp-rg \
542
+ --sku P2V2
543
+ ```
544
+
545
+ ## Cost Optimization
546
+
547
+ ```bash
548
+ # Use Free/Shared tier for development
549
+ az appservice plan create --sku F1
550
+
551
+ # Use Basic tier for small production apps
552
+ az appservice plan create --sku B1
553
+
554
+ # Enable auto-scaling to scale down during low traffic
555
+ # Stop app when not in use (dev/test)
556
+ az webapp stop --name myapp --resource-group myapp-rg
557
+ ```
558
+
559
+ ## References
560
+
561
+ - [Azure App Service Documentation](https://docs.microsoft.com/azure/app-service/)
562
+ - [Azure CLI Reference](https://docs.microsoft.com/cli/azure/webapp)
563
+ - [Deployment Best Practices](https://docs.microsoft.com/azure/app-service/deploy-best-practices)
564
+ - [App Service Pricing](https://azure.microsoft.com/pricing/details/app-service/)