Skip to content

feat(python): Enable Multi-App Run for Python HTTP and SDK bindings q…#1297

Merged
alicejgibbons merged 2 commits intodapr:masterfrom
AdepuSriCharan:feature/python-multiapp-bindings
Mar 18, 2026
Merged

feat(python): Enable Multi-App Run for Python HTTP and SDK bindings q…#1297
alicejgibbons merged 2 commits intodapr:masterfrom
AdepuSriCharan:feature/python-multiapp-bindings

Conversation

@AdepuSriCharan
Copy link
Contributor

Description

This PR enables Dapr Multi-App Run for the Python bindings quickstarts (HTTP and SDK).

Previously, the Python quickstarts required running the application using a long dapr run command with multiple flags:

dapr run --app-id batch-http --app-port 50051 --resources-path ../../../components -- python3 app.py

With this change, the quickstarts can now be started using the simplified Multi-App Run configuration:

dapr run -f .

This aligns the Python quickstarts with the already updated Java and JavaScript bindings quickstarts and improves the onboarding experience by reducing manual setup.

Changes

  • Added Multi-App Run configuration using dapr.yaml
  • Updated README.md instructions to use dapr run -f .
  • Added a Prerequisites section
  • Added a Verify Data Persistence step
  • Updated appPort from 50051 to 5001 to match the Flask application
  • Standardized DAPR_HTTP_PORT to 3500
  • Ensured resourcesPath correctly points to ../../../components
  • Updated quickstarts:
    • bindings/python/http
    • bindings/python/sdk

Verification

Tested locally.

1. Start the database

cd bindings/db
docker compose up -d

2. Install dependencies

For HTTP quickstart:

cd bindings/python/http/batch
pip3 install -r requirements.txt

For SDK quickstart:

cd bindings/python/sdk/batch
pip3 install -r requirements.txt

3. Run the quickstart

cd ..
dapr run -f .

Observed behavior

  • Python service starts successfully
  • Dapr sidecar initializes
  • Cron binding triggers every 10 seconds
  • Orders are inserted into PostgreSQL

Example output:

Processing batch..
insert into orders (orderid, customer, price) values (1, 'John Smith', 100.32)
insert into orders (orderid, customer, price) values (2, 'Jane Bond', 15.4)
insert into orders (orderid, customer, price) values (3, 'Tony James', 35.56)
Finished processing batch

Verify database persistence

docker exec postgres psql -U postgres -d orders -c "SELECT * FROM orders;"

Rows increase over time confirming the full end-to-end flow.

Automated validation

Validation was also verified locally using mechanical-markdown:

mm.py -l -s "bash -c" README.md

Checklist

  • The quickstart code compiles correctly
  • The quickstart was tested locally
  • README has been updated
  • Automated validation annotations remain compatible with mechanical-markdown

…uickstarts

Signed-off-by: Adepu Sri Charan <sricharan.adepu36@gmail.com>
@AdepuSriCharan AdepuSriCharan requested review from a team as code owners March 14, 2026 17:14
@JoshVanL JoshVanL requested review from Copilot and removed request for a team March 14, 2026 17:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Dapr Multi-App Run (dapr run -f .) for the Python bindings quickstarts (HTTP + SDK), aligning them with other language quickstarts and simplifying the run instructions.

Changes:

  • Updated Python HTTP/SDK dapr.yaml to use appPort: 5001 (matching the Flask apps).
  • Updated README instructions (prereqs, dapr run -f ., and a database verification step) for both quickstarts.
  • Standardized Python HTTP quickstart default DAPR_HTTP_PORT to 3500.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
bindings/python/sdk/dapr.yaml Updates app port to 5001 for multi-app run config.
bindings/python/sdk/batch/app.py Updates header comment to reference dapr run -f ..
bindings/python/sdk/README.md Adds prerequisites, switches run command to multi-app run, adds persistence verification step.
bindings/python/http/dapr.yaml Updates app port to 5001 for multi-app run config.
bindings/python/http/batch/app.py Updates header comment to reference dapr run -f . and aligns default Dapr HTTP port.
bindings/python/http/README.md Adds prerequisites, switches run command to multi-app run, adds persistence verification step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Alice Gibbons <alicejgibbons@gmail.com>
Copy link
Contributor

@alicejgibbons alicejgibbons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks for your contribution!

@alicejgibbons alicejgibbons merged commit c8fc93d into dapr:master Mar 18, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants