Can I use same azure function to be trigger based on time and on demand(HTTP trigger) as well ?

Palash Mathur 60 Reputation points
2024-07-24T09:30:57.4833333+00:00

I want to write a azure function that gets trigger based on schedule time basis, also I want this function to be invoked from HTTP request based on demanad.
Is this supported in the Azure function or not?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,095 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 28,631 Reputation points Microsoft Employee
    2024-07-25T21:34:24.4366667+00:00

    Hi @Palash Mathur

    It's certainly doable. You can refer to https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-function-app-portal?pivots=programming-language-csharp and https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-scheduled-function which are quick starts on how to create an HTTP trigger and Timer trigger respectively.

    Since you want the logic of the function to be executed by two separate functions, then you can encapsulate the logic into an object that can be instantiated and invoked by both functions.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.