Skip to content

Redis and tasks

Redis sidecar

add_django_website(..., redis_sidecar=True) (default) attaches a Redis container (mcr.microsoft.com/mirror/docker/library/redis:7.2) to the Web App and sets REDIS_SIDECAR=true.

Django settings then configure django_redis against redis://localhost:6379/0, with exceptions ignored so the site can start if Redis is briefly unavailable.

Django tasks

django_tasks=True (default) requires redis_sidecar=True and sets DJANGO_TASKS=true. Settings wire:

  • RQ_QUEUES using the Redis cache
  • TASKS backend django_tasks_rq.RQBackend

patch_django_settings_for_azure adds django_rq and django_tasks_rq to INSTALLED_APPS.

At startup, supervisord runs:

python manage.py rqworker --job-class django_tasks_rq.Job

(with a long timeout so Entra credentials can refresh).

Disabling

django.add_django_website(
    # ...
    redis_sidecar=False,
    django_tasks=False,
)

Setting django_tasks=True with redis_sidecar=False raises ValueError.