0

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.

umad44
  • 1
  • 2

1 Answers1

0

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

Doris Lv
  • 3,083
  • 1
  • 5
  • 14
  • Hi Doris Lv, thanks for your answer. I am able to see the logs, but I am not able to navigate to my defined logic i.e. execute_timer() and it says execution failed. Also, do i need to add anything in function.json file ? – umad44 Aug 20 '20 at 04:26
  • You don't need to add anything in function.json file. About your i.e.execute_timer(), could you please post the details?@umad44 – Doris Lv Aug 20 '20 at 05:27