Enhance python starter template#12215
Conversation
- Rename api_service to app - Add WaitFor for the redis cache - Make redis cache optional in the template - Fix a 500 error when the static folder doesn't exist. Check if the folder exists before mapping it - Add logging to the console as well as to OTLP - Remove the uv.lock file. That will be created when uv sync is run
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12215Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12215" |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Python starter template by making Redis caching optional and improving configuration consistency. The changes rename the API service to "app" for better clarity, add health checks and proper startup dependencies, improve error handling for static file serving, and enable dual logging to both console and OTLP.
Key changes:
- Redis caching is now optional via a
UseRedisCachetemplate parameter - Service renamed from
apiservicetoappfor consistency across frontend and backend - Added health checks,
WaitFordependencies, and console logging support
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/vite.config.ts | Updated proxy target to reference renamed app service |
| apphost.cs | Added conditional Redis support, health checks, and WaitFor dependency |
| app/telemetry.py | Added console logging handler alongside OTLP logging |
| app/pyproject.toml | Updated project name and made Redis instrumentation conditional |
| app/app.py | Made Redis client and caching logic conditional, added static folder existence check |
| .template.config/template.json | Added UseRedisCache parameter definition |
| .template.config/localize/templatestrings.en.json | Added localized strings for new parameter |
| .template.config/ide.host.json | Added symbol info for IDE integration |
| .template.config/dotnetcli.host.json | Added CLI mapping for new parameter |
Add the parameter support to the CLI
|
I deployed the version without redis to appservice and it didn't work. Trying to debug, I'm not sure if it's related though. |
Did you ever figure this out? It deploys successfully for me. And when I try to hit it, it prints something to the console log: But the page never gets served. |
Contributes to #12199