Skip to content

Background Processes

The Function App runs several background processes on Azure timer triggers. These are not HTTP-callable - they execute on a schedule managed by the Azure Functions runtime.

Schedule: Every 10 minutes (0 */10 * * * *)

Processes the room-deletion-queue to clean up VMRs after sessions end.

flowchart TD
    A[Timer fires] --> B[Pop up to 20 messages from room-deletion-queue]
    B --> C{Messages found?}
    C -->|No| Z[Exit - nothing to do]
    C -->|Yes| D[Fetch all rooms from Pexip]
    D --> E[Remove persistent rooms from list]
    E --> F{For each queue message}
    F --> G{Room exists on Pexip?}
    G -->|No| H[Delete orphaned queue message]
    G -->|Yes| I{Message older than 10 min?}
    I -->|No| J[Skip - too recent]
    I -->|Yes| K[Delete room on Pexip]
    K --> L[Delete queue message]
    H --> F
    J --> F
    L --> F

Pexip sends a conference_ended event when the last participant leaves. However, brief disconnections (network hiccups, page refreshes) can cause a room to appear “ended” momentarily before the participant reconnects. The 10-minute delay prevents premature deletion during these transient states.

Rooms whose names start with configured prefixes are never garbage-collected:

  • test_ - manual testing rooms
  • vkiosk_ - virtual kiosk rooms

Endpoint: POST /public/event_sink (HTTP Basic auth)

Pexip Infinity is configured to send event sink webhooks to this endpoint. The Function App:

  1. Receives all event types from Pexip
  2. Filters for conference_ended events only
  3. Extracts the room name from event.data.name (fallback: event.data.conference)
  4. Adds the room name to the room-deletion-queue

The actual deletion happens via the garbage collection timer (above), not immediately upon event receipt.

On the Pexip Management Node, the event sink is configured under Platform > Event Sinks:

SettingValue
URLhttps://api.vc.maxconf.ca/public/event_sink
AuthenticationHTTP Basic
UsernameStored in Key Vault
PasswordStored in Key Vault

Schedule: Every 5 minutes (0 */5 * * * *, runs on startup)

Collects operational metrics and writes them to a Log Analytics workspace:

MetricSource
Queue depth (room-creation-queue)Azure Storage Queue
Available VMRsPexip Management API
In-use VMRsPexip Management API
Pexip alarm statusPexip Management API
Pexip connectivityPexip Management API

The pre-provisioned room pool is managed through:

  1. Initial provisioning: POST /room/bulk/ creates rooms up to MAX_VMR and populates the queue
  2. Steady-state replenishment: Each POST /room/create request triggers a background task to create one replacement room
  3. Reset: DELETE /room/bulk/ clears all rooms and the queue (used before reprovisioning)
graph LR
    subgraph "room-creation-queue"
        Q1[room_abc123]
        Q2[room_def456]
        Q3[room_ghi789]
    end

    subgraph "room-deletion-queue"
        D1[room_xyz999]
    end

    CREATE[POST /room/create] -->|pop| Q1
    CREATE -->|push new| Q3
    EVENT[Event Sink] -->|push| D1
    GC[Garbage Collector] -->|pop| D1