I created a google cloud source repository and added the following in main.py (in my root directory)
def sample_function(event, context):
print('inside sample_function')
return True
I deployed the function using the following command:
$ gcloud beta functions deploy sample_function \
--entry-point sample_function \
--runtime python37 \
--source https://source.developers.google.com/projects/project_id/repos/repository_id/moveable-aliases/my_branch_name \
--region europe-west1 \
--trigger-event providers/cloud.firestore/eventTypes/document.create \
--timeout 60s \
--trigger-resource projects/my_project_id/databases/default/documents/finalDb/{orgId}/tasks/{taskId}
The function was deployed successfully as shown:
But the cloud function is not triggered when a document is added at the specified trigger path.I checked the cloud function logs and there was no entry in the log to showcase that the function executed.
What could be the issue? Am I missing something during deployment?
P.S I wrote the similar functions using the inline editor and they seem to work fine