Azure Scheduler
Reference · Applies to Brighter V10
Azure Service Bus includes native support for scheduled message delivery using the ScheduledEnqueueTimeUtc property. In V10, Brighter integrates with Azure Service Bus's built-in scheduling capabilities to provide cloud-native scheduling for Azure workloads.
When to Use Azure Service Bus Scheduler
Azure Service Bus Scheduler is recommended when:
Running on Azure: Your application is deployed on Azure (VMs, App Service, AKS, Functions, etc.)
Using Service Bus: Already using Azure Service Bus for messaging
Cloud-Native: Prefer Azure-managed services over self-hosted solutions
Simple Scheduling: Need basic scheduling without complex dependencies
Azure Ecosystem: Want to leverage Azure services directly
Cost-Effective: Want to avoid additional scheduler infrastructure
When NOT to use:
Multi-Cloud: Need scheduler to work across cloud providers
On-Premises: Application runs outside Azure
Reschedule Support: Need to modify scheduled time without cancel/recreate
Complex Scheduling: Need advanced features (recurring schedules, job chains, dependencies)
Dashboard: Need visual management interface
How Brighter Integrates with Azure Service Bus Scheduler
Brighter uses Azure Service Bus's native ScheduledEnqueueTimeUtc property through the FireAzureScheduler message approach:
Why FireAzureScheduler Approach?
Unlike AWS EventBridge Scheduler (which can directly target any SNS/SQS), Azure Service Bus requires a topic/queue to hold the scheduled message. Brighter uses a centralized scheduler topic to handle all scheduled messages, then dispatches them to the appropriate handlers.
Authentication and Credentials
Azure Service Bus Scheduler uses Azure Service Bus client providers for authentication. Brighter supports multiple authentication methods:
Managed Identity (Recommended for Production)
Visual Studio Credentials (Development)
Connection String (Simple, Less Secure)
Default Azure Credentials (Flexible)
Best Practice: Use Managed Identity in production, Visual Studio/Default credentials for development.
RBAC Permissions Required
When using Managed Identity or Azure AD authentication, the identity must have these Azure RBAC roles:
Azure Service Bus Data Sender: To send scheduled messages
Azure Service Bus Data Receiver: To receive FireAzureScheduler messages (Dispatcher)
Azure Scheduler NuGet Package
To use Azure Service Bus Scheduler, install:
Package: Paramore.Brighter.MessageScheduler.Azure
Dependencies:
Azure.Messaging.ServiceBus- Azure Service Bus SDKParamore.Brighter.MessagingGateway.AzureServiceBus- Brighter's Azure Service Bus transport
Azure Scheduler Configuration
Azure Scheduler Factory Options
AzureServiceBusSchedulerFactory takes the client provider and the scheduler topic as constructor arguments, and reads both back as properties you can also set on the initialiser.
ClientProvider
IServiceBusClientProvider
null
Supplies the Service Bus client the scheduler sends through, and carries the credential.
SenderOptions
ServiceBusSenderOptions?
null
The options the scheduler creates its Service Bus sender with.
InstrumentationOptions
InstrumentationOptions
All
How much telemetry the scheduler records for a retry it sends to a queue, when a publication selects it with RequeueScheduler = RequeueSchedulerMode.Global.
Topic
RoutingKey
none
Names the topic or queue scheduled messages are sent to.
TimeProvider
TimeProvider
TimeProvider.System
The clock the scheduler measures delays against.
ClientProvider and Topic are constructor arguments rather than properties with defaults, so every factory supplies both. Setting them on the initialiser replaces what you passed; neither can be left out.
Basic Configuration
Configure Azure Service Bus Scheduler with minimal settings:
Configuration with Dispatcher (FireAzureScheduler Handler)
Configure the Dispatcher to handle FireAzureScheduler messages:
Configuration with Custom Sender Options
Customize Azure Service Bus sender behavior:
Configuration with Custom TimeProvider
Use a custom time provider for testing:
Azure Scheduler Code Examples
Basic Scheduling with Delay
Schedule a command to execute after a delay:
Scheduling with Absolute Time
Schedule for a specific time:
Cancelling a Scheduled Job
Cancel a scheduled task before it executes:
Rescheduling (Cancel + Schedule)
Since Azure doesn't support rescheduling, cancel and create a new schedule:
Azure Scheduler Best Practices
1. Use Managed Identity in Production
2. Use Separate Scheduler Topic
3. Handle Reschedule as Cancel + Schedule
4. Set Appropriate Message TTL
5. Monitor with Azure Monitor
6. Use Service Bus Premium for Production
7. Configure Dead-Letter Queue
8. Test Locally with Azurite
Azure Scheduler Troubleshooting
Scheduled Messages Not Executing
Symptom: Messages scheduled but never delivered
Possible Causes:
FireAzureScheduler subscription not configured
Incorrect topic name
Message TTL expired before scheduled time
Service Bus connection issues
RBAC permissions missing
Solutions:
Authentication Failures
Symptom: UnauthorizedAccessException when scheduling
Cause: Missing RBAC permissions or invalid credentials
Solution:
Reschedule Not Working
Symptom: Attempting to reschedule fails or has no effect
Cause: Azure Service Bus doesn't support rescheduling
Solution:
Messages Going to Dead-Letter Queue
Symptom: Scheduled messages end up in dead-letter queue
Possible Causes:
Handler exceptions not properly handled
Message processing timeout exceeded
Maximum delivery count reached
Invalid message format
Solutions:
Related Documentation
Brighter Scheduler Support - Overview of scheduling in Brighter
Switching Schedulers - Moving to or from this scheduler
Azure Service Bus Configuration - Configuring Azure Service Bus transport
AWS Scheduler - AWS equivalent
Quartz Scheduler - Alternative for non-Azure environments
Hangfire Scheduler - Alternative with dashboard
InMemory Scheduler - For testing and development
Azure Scheduler External Links
Azure Scheduler Summary
Azure Service Bus Scheduler leverages Azure Service Bus's native scheduling capabilities for cloud-native scheduling:
Native Integration - Uses Azure Service Bus
ScheduledEnqueueTimeUtcManaged Service - No separate scheduler infrastructure
Simple Setup - If already using Azure Service Bus
Azure Ecosystem - Integrates with Azure monitoring and security
Recommended for production when running on Azure and using Azure Service Bus. Consider Quartz.NET or Hangfire for multi-cloud or on-premises deployments.
Key Decision Factors:
✅ Use Azure Service Bus Scheduler if: Running on Azure, using Service Bus, want simplicity
✅ Use AWS Scheduler if: Running on AWS, need reschedule support
✅ Use Quartz if: Multi-cloud, complex scheduling, need job clustering
✅ Use Hangfire if: Need dashboard, simple setup, OK without strong naming
✅ Use InMemory if: Testing only, not for production
Important Note: Azure Service Bus does NOT support rescheduling. Use cancel + schedule pattern when rescheduling is needed.
Last updated
Was this helpful?
