'System.Private.CoreLib: Result: Failure Exception: KeyError: '__main__' Azure timer trigger function using Python

I am trying to build a Azure Timer Trigger Function using Python. But when i am trying to execute some function to do some calculation from database in the "main" function, its through me a failure Exception(Please see the image.) Can some one share your experience please?

enter image description here



Solution 1:[1]

This might be a version issue of azure functions core tool. Updating the Function Tool to V4 could resolve the issue.

Also you can refer [BUG] Local Debugging Fails With "KeyError: 'main'" where they were dealing with a similar issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SwethaKandikonda-MT