Skip to main content

taskferry-servicebus

Run Taskferry tasks on Azure Service Bus — pull-based delivery with unrestricted scheduling.

flowchart LR
    APP["Application"] --> TP["Taskferry"] --> AD["taskferry-servicebus"] --> Q["Service Bus queue"] --> C["Azure Functions · Container Apps"]
pip install 'taskferry-servicebus[azure]'

Why it is a separate package from SQS

Both are pull-based queues, and they differ where it counts: scheduled_enqueue_time_utc accepts any future time, so a task deferred by a week is a first-class operation here and impossible on SQS, which caps at 900 seconds.

One "queue adapter with a flag" would have to pick a lowest common denominator. Two adapters with two honest capability sets do not. See ADR-0005.

Sending

runtime = Taskferry.from_mapping(
    {
        "backends": {
            "sb": {
                "factory": "servicebus",
                "connection_string": "Endpoint=sb://...",
                "queue_name": "tasks",
            }
        },
        "defaults": {"task": "sb"},
    }
)

runtime.tasks.submit("myapp.tasks:reindex", 42, delay=timedelta(days=7))

Managed Identity instead of a connection string:

{
    "factory": "servicebus",
    "namespace": "myns.servicebus.windows.net",
    "credential": DefaultAzureCredential(),
    "queue_name": "tasks",
}

Consuming

Azure Functions:

from taskferry import FunctionRegistry
from taskferry_servicebus import process_message

REGISTRY = FunctionRegistry(allowed_modules=["myapp"])


def main(msg: func.ServiceBusMessage) -> None:
    process_message(msg.get_body(), registry=REGISTRY)

Container Apps / a plain process:

from taskferry_servicebus import receive_forever

receive_forever(client, "tasks", registry=REGISTRY)

Completes on success, abandons on failure so Service Bus redelivers and eventually dead-letters per the queue's MaxDeliveryCount.

Capabilities

Capability Supported How
SUBMIT yes send_messages
DELAY yes scheduled_enqueue_time_utc, unbounded
RETRY yes the queue's delivery count and dead-letter policy
DEDUPLICATION yes message_id, when the queue has duplicate detection on
STATE · RESULT · CANCEL no no lookup of one message after enqueue

DEDUPLICATION is real but bounded by the queue's duplicate-detection window — a tool for idempotency, never an exactly-once promise. See ADR-0010.

License

Apache-2.0.

Release files for taskferry-servicebus 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for taskferry-servicebus 0.2.0
File Size Uploaded
taskferry_servicebus-0.2.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for taskferry-servicebus 0.2.0
File Interpreter ABI Platform
taskferry_servicebus-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.7 kB

Release files / taskferry_servicebus-0.2.0.tar.gz

Download URL taskferry_servicebus-0.2.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
03cdb13c497177b0d5859ab19bbd98473577aaa9ea5ccc2fb00983e26dc9fe0b
BLAKE2b-256 checksum
How to use checksums
31a3b39bddab63e9d6c5ebce255e5a8262f1b4824537040b673a4c31aa2d591a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / taskferry_servicebus-0.2.0-py3-none-any.whl

Download URL taskferry_servicebus-0.2.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11c4b73203a4d124bdcc4f62540c7ad4a8fc68c9c3618879dccc7f6e1b329edc
BLAKE2b-256 checksum
How to use checksums
a029ba97607135cc05df88a6bbd9cbbbd1241159fb986deb903396000f5d68d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page