umad44
umad44

Reputation: 1

Timer Trigger in Azure function is not working when i do Code+test

I created a timer trigger in Azure function in my Visual Studio as below and deployed it in the Azure Portal. Once i try to do a Code+Test it is giving me Output as HTTP response code : 202 Accepted HTTP response content(It is displayed blank)

__init__.py 

import os
import json
import logging
import requests
import numpy as np
import pandas as pd
import azure.functions as func
import azure.storage.blob
from azure.storage.blob import BlockBlobService

def main(mytimer: func.TimerRequest) -> None:
    utc_timestamp = datetime.datetime.utcnow().replace(
        tzinfo=datetime.timezone.utc).isoformat()

    if mytimer.past_due:
        logging.info('The timer is past due!')
    logging.info('Python timer trigger function ran at %s', utc_timestamp)

execute_timer() # This function is business logic and basically it saves CSV file in a container BLOB.

function.json

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

When i deploy and run it. It gives me 202 accepted but i can not see my output generated or it to be scheduled.

Can anyone help me out of this.

Upvotes: 0

Views: 747

Answers (1)

Doris Lv
Doris Lv

Reputation: 3398

To see the out put information, you need to connect the Logs under the window. enter image description here

After clik Logs, wait a minute for connecting and logging, you will see this. enter image description here

Upvotes: 0

Related Questions