cloud function file name

Viewed 863

I am trying to deploy Cloud Function. I have written the function in file called gcpapp.py.

When I try to deploy this function, it gives me an error saying Deployment failure: Function load error: File main.py that is expected to define function doesn't exist.

I entered appgcp.main as Function to execute where appgcp is the file name and main is the function name.

Do I must name the file where the function resides as main.py?

1 Answers

Yes, you must name your file main.py. According to the documentation:

Source code structure

Your function's entrypoint must be defined in a Python source file named main.py.

Related