Search code examples
azure-functionsazure-triggerstimer-triggerqueuetrigger

How to make Timer Trigger call the Queue Trigger with the help of the queue messages?


For example, I have 2 queue triggers which are to be called by 2 different messages of queue trigger in Timer Trigger function. How do I call the triggers in the timer and automate the messages so that when Timer function is triggered and it automatically sends messages to respective queues using python language?

Thanks in advance.


Solution

  • Below is the sample code for Timer trigger to call the queue trigger function.

    enter image description here

    host.json

    {
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
          }
        }
      },
      "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[1.*, 2.0.0)"
      }
    }
    

    function.json

    {
      "scriptFile": "__init__.py",
      "bindings": [
        {
          "name": "mytimer",
          "type": "timerTrigger",
          "direction": "in",
          "schedule": "*/20 * * * * *"
        }
      ]
    }
    

    for further information check the related SO1 and SO2