Adarsh
Adarsh

Reputation: 3573

Firestore cloud functions not triggered when deployed from cloud source repository

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:

enter image description here

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

Upvotes: 1

Views: 677

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317552

Firebase-specific triggers (including Firestore) are currently not supported for python and gcloud.

EDIT

gcloud now has support for writing and deploying Firestore triggers in all supported languages.

Upvotes: 1

Related Questions