Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase cloud functions using Python?

We are using GCP's Firebase with Firestore for a new mobile app we are developing. As part of this effort we need to deploy a number of cloud functions which will act as Firestore triggers for doing some back end processing.

Our intention is to keep the deploys encapsulated inside of Firebase by using the firebase cli tools. However when we attempt to initiate the Firebase project for functions using the "firebase init functions" call the only two language options are "Javascript" and "Typescript", and the only deployable stack seems to be Node.js.

On previous GCP projects we had deployed Python based cloud functions (using the gcloud cli) and ideally we'd like to continue using Python for our Firebase cloud functions. So my questions are:

  1. is it possible to deploy Python-based Firebase cloud functions? If not:

  2. can we simply go back to deploying Python-based GCP cloud functions using the gcloud cli and still have them work as Firestore triggers?

Thanks

like image 378
Gatmando Avatar asked Jul 22 '19 15:07

Gatmando


People also ask

Can I use python for Firebase functions?

The Firebase CLI does not support deploying functions written in python. You can certainly write Cloud Firestore triggers in python and deploy them with gcloud. One thing you might not be aware of: the underlying Cloud Functions product is the same no matter how you deploy your functions.

Is Firebase Cloud Functions free?

Cloud Functions includes a perpetual free tier for invocations to allow you to experiment with the platform at no charge. Note that even for free tier usage, we require a valid billing account.


1 Answers

The Firebase CLI does not support deploying functions written in python.

You can certainly write Cloud Firestore triggers in python and deploy them with gcloud.

One thing you might not be aware of: the underlying Cloud Functions product is the same no matter how you deploy your functions. Firebase just adds tools and APIs on top of the existing Google Cloud Functions infrastructure. There is really no such thing as a "Firebase Cloud Function". There is just Cloud Functions, and you have options about how you can write and deploy them, either using gcloud, or the Firebase CLI.

like image 145
Doug Stevenson Avatar answered Sep 22 '22 14:09

Doug Stevenson