Can we make custom events for future in Azure Event Grid ?

Koushik Purva Mahendra 25 Reputation points
2023-05-15T19:22:58.4866667+00:00

Hello Microsoft,

My question is that can I make custom events in azure Event Grid to trigger my azure function in coming future, for example can I make a Event in Azure event grid to get trigger my azure function tomorrow or day after tomorrow or after 10 days, is it possible that I have to trigger my azure function for next 60 days daily at a specific time so I can make straight 60 Custom events in azure event grid for a specific time and now that each event will trigger my azure function at specific date and time I given to the event.

Please clear my concern as this is on priority basis for me.

Thanks.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,232 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
312 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 68,396 Reputation points
    2023-05-16T09:47:07.66+00:00

    @Koushik Purva Mahendra Thanks for reaching out. Unfortunately, you cannot schedule the events for the future date in the event grid. The alternative will be using the Service Bus to schedule the message by specifying the ScheduledEnqueueTimeUtc property on the message before sending it. Based on the schedule time the message will be visible in the queue to be consumed and your function app with service bus trigger can consume those messages. For more details, please refer to this document.

    Feel free to get back to me if you have any queries or concerns.

    Please "Accept Answer" if the answer is helpful so that it can help others in the community.


  2. Roman Kiss 2,241 Reputation points
    2023-05-17T18:00:29.7533333+00:00

    Hi @Koushik Purva Mahendra ,

    Your requirement such as delaying of the event delivery in the AEG can be achieved without coding using an Azure Service Bus Topic entity with ForwardTo feature and Rule Action for setting a message sys properties (such as sys.ScheduledEnqueueTimeUtc, sys.Label, etc.). The following picture shows this solution:

    User's image

    The Delay value can be configured in the Delivery Properties of the Event Subscription (statically or dynamically from the event) and used it in the Rule Action. As a destination resource can be used a Service Bus Queue or Topic based on your needs.

    Thanks

    Roman