Commit 4d97401
authored
Fix/verbose appconfig logging (#8)
* fix: enable verbose logging for Azure App Configuration
- Add logx.Init(verbose) in CLI root initialization
- Ensures Azure App Configuration debug logs are shown with --verbose flag
- Fixes issue where appconfig.go debug logs were suppressed
- No functional changes, only improves logging visibility
* fix: use APP_CONFIG_LABEL environment variable for Azure App Config
- Fix Azure App Configuration provider to read APP_CONFIG_LABEL env var
- Previously was using environment name instead of actual label
- This fixes the issue where service-specific keys weren't being fetched
- Now properly fetches keys with the correct label (e.g., 'dev')
* improve: better error handling and simplified label logic
- Use --env flag directly as Azure App Config label (dev/staging/prod)
- Remove dependency on APP_CONFIG_LABEL environment variable
- Add user-friendly warning messages for malformed JSON in Azure App Config
- Provide specific guidance on common JSON issues (missing commas, duplicate keys)
- This makes the tool easier to use and provides better error messages
* fix: update ACR validation test to work with Azure App Config changes
- Add APP_CONFIG_SKIP=true to disable Azure App Configuration in test
- Clean up environment variables properly in test
- Fix linting issues (errcheck and line length)
- Ensures test validates missing variables correctly without interference from global config
* fix: make malformed JSON in Azure App Config fail deployment
CRITICAL FIX: Malformed JSON in Azure App Configuration now fails deployment instead of just warning.
- Change all JSON parsing errors from WARN to ERROR with proper error returns
- Malformed JSON prevents NEXT_PUBLIC_* variables from being passed as build args
- This ensures applications get required environment variables or deployment fails
- Add fmt import and fix linting issues with error return value checks
- Provides clear error messages about JSON issues (missing commas, duplicate keys)
This prevents silent failures where apps deploy without required environment variables.
* fix: add auto-detection of IMAGE_NAME and IMAGE_TAG to WebApp command
- WebApp command now auto-detects IMAGE_NAME and IMAGE_TAG from CI environment like ACI and ACR commands
- Uses same detectImageNameFromCI() and detectImageTagFromCI() functions
- Ensures consistency across all deployment commands (ACR, ACI, WebApp)
- Fixes issue where WebApp required manual IMAGE_NAME/IMAGE_TAG while ACI worked automatically
- Now WebApp deployment works seamlessly in CI/CD pipelines without manual variable setup
* fix: WebApp now sets environment variables from Azure App Configuration
- WebApp deployment now calls setWebAppSettings() to configure app settings
- Uses 'az webapp config appsettings set' to pass environment variables to container
- Filters out internal azctl variables (ACR_*, RESOURCE_GROUP, etc.)
- Only passes application-specific variables like NEXT_PUBLIC_* to container
- Fixes issue where WebApp containers couldn't access Azure App Config variables
- Now WebApp behavior matches ACI in terms of environment variable injection
* fix: WebApp now correctly filters environment variables from Azure App Configuration
- WebApp now only sets application-specific environment variables (like ACI does)
- Added isApplicationVariable() function to filter variables by prefixes:
* NEXT_PUBLIC_* (React/Next.js public variables)
* SUPABASE_*, SOLANA_*, AZURE_OPENAI_*, OPENAI_*, LOGFLARE_*, FIREBASE_*, SAGEMAKER_*
* PORT, NODE_ENV, ENVIRONMENT
- Filters out infrastructure variables (PATH, USER, SHELL, etc.) that shouldn't go to containers
- Now sets only 10 relevant application settings instead of 69+ system variables
- Matches ACI behavior where only service-specific variables are passed to containers
- Fixes issue where WebApp was trying to set system environment variables
* fix: remove unnecessary quotes from WebApp environment variables
- Modified escapeShellValue() to not wrap values in quotes
- Azure CLI webapp config appsettings set handles values properly without quotes
- Environment variables now set without literal quote characters
- Fixes issue where URLs like 'https://example.com' had quotes in the actual value
* fix: WebApp now uses proper ACR authentication like ACI
- Fixed container image format: chiswarm/swarm-nextjs-fe -> chiswarm.azurecr.io/swarm-nextjs-fe
- Added setWebAppRegistryCredentials() function to set Docker registry credentials
- Maps ACR credentials to WebApp Docker registry settings:
* DOCKER_REGISTRY_SERVER_URL=https://chiswarm.azurecr.io
* DOCKER_REGISTRY_SERVER_USERNAME=chiswarm (from ACR_USERNAME)
* DOCKER_REGISTRY_SERVER_PASSWORD=<ACR_PASSWORD>
- Now WebApp authentication matches ACI authentication exactly
- Fixes 'pull access denied' errors in WebApp deployment center logs
* fix: clean up formatting in webapp.go
- Remove trailing whitespace
- Fix line ending formatting1 parent 0527810 commit 4d97401
File tree
5 files changed
+250
-14
lines changed- internal
- cli
- config
5 files changed
+250
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
| |||
158 | 174 | | |
159 | 175 | | |
160 | 176 | | |
161 | | - | |
162 | | - | |
| 177 | + | |
| 178 | + | |
163 | 179 | | |
| 180 | + | |
164 | 181 | | |
165 | 182 | | |
166 | 183 | | |
| |||
169 | 186 | | |
170 | 187 | | |
171 | 188 | | |
172 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
173 | 300 | | |
| 301 | + | |
| 302 | + | |
174 | 303 | | |
175 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | | - | |
87 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
121 | | - | |
122 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
123 | 136 | | |
124 | 137 | | |
125 | 138 | | |
| |||
146 | 159 | | |
147 | 160 | | |
148 | 161 | | |
149 | | - | |
150 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
151 | 171 | | |
152 | 172 | | |
153 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
| |||
0 commit comments