google-cloud-functions

Test Python Google Cloud Functions locally

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-16 16:49:42
问题 I'm trying out the Python3.7 runtime on Google Cloud Functions. I am able to deploy the functions and make them work once deployed, however, I can't seem to run the emulator to test them locally before I deploy. Google's documentation is a little inconsistent where they tell you to install the google functions emulator here: https://cloud.google.com/functions/docs/emulator But over on Firebase they tell you to npm install firebase-admin, firebase-tools and firebase-functions. All of the

Google Cloud Functions - How to securely store service account private key when using Google Source Repository?

老子叫甜甜 提交于 2020-07-14 22:31:56
问题 I use Google Source Repository to store my Google Cloud Functions. (Git repo hosted by Google, basically) One of my function needs to access a private Google Sheet file, I therefore created a Service Account. (With way too many rights since it's so hard to understand what exact rights we should give to a service account, and so hard to update later on, but I digress) Now, it's clearly not recommended to store the Service Account JSON file in the git repository itself for obvious reasons. Here

Google Cloud Functions - How to securely store service account private key when using Google Source Repository?

那年仲夏 提交于 2020-07-14 22:29:39
问题 I use Google Source Repository to store my Google Cloud Functions. (Git repo hosted by Google, basically) One of my function needs to access a private Google Sheet file, I therefore created a Service Account. (With way too many rights since it's so hard to understand what exact rights we should give to a service account, and so hard to update later on, but I digress) Now, it's clearly not recommended to store the Service Account JSON file in the git repository itself for obvious reasons. Here

Is Function Cloud in Firebase Free or Not (Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan)

久未见 提交于 2020-07-13 15:10:32
问题 When i make my first deploy function I can't deploying Because I have Error Asks me to make Upgrade to my account to Blaze I need to Know Can i deploy Function when i use free account?? Output: i deploying functions i functions: ensuring required API cloudfunctions.googleapis.com is enabled... i functions: ensuring required API cloudbuild.googleapis.com is enabled... ! functions: missing required API cloudbuild.googleapis.com. Enabling now... + functions: required API cloudfunctions

Is Function Cloud in Firebase Free or Not (Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan)

萝らか妹 提交于 2020-07-13 15:09:46
问题 When i make my first deploy function I can't deploying Because I have Error Asks me to make Upgrade to my account to Blaze I need to Know Can i deploy Function when i use free account?? Output: i deploying functions i functions: ensuring required API cloudfunctions.googleapis.com is enabled... i functions: ensuring required API cloudbuild.googleapis.com is enabled... ! functions: missing required API cloudbuild.googleapis.com. Enabling now... + functions: required API cloudfunctions

Is Function Cloud in Firebase Free or Not (Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan)

时光怂恿深爱的人放手 提交于 2020-07-13 15:07:47
问题 When i make my first deploy function I can't deploying Because I have Error Asks me to make Upgrade to my account to Blaze I need to Know Can i deploy Function when i use free account?? Output: i deploying functions i functions: ensuring required API cloudfunctions.googleapis.com is enabled... i functions: ensuring required API cloudbuild.googleapis.com is enabled... ! functions: missing required API cloudbuild.googleapis.com. Enabling now... + functions: required API cloudfunctions

Firebase Storage Admin Error:400 Invalid Bucket Name

六月ゝ 毕业季﹏ 提交于 2020-07-10 11:43:23
问题 I'm trying to use firebase functions to do maintenance of my database and storage. Basically remove some old entries from one ref/bucket to another after they expire. The database part works great. However, the storage part, not so much. Here's how I initialize everything in my code: var functions = require('firebase-functions'); var admin = require("firebase-admin"); var serviceAccount = require('./my-app-bla-bla.json'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount)

Firebase Storage Admin Error:400 Invalid Bucket Name

喜欢而已 提交于 2020-07-10 11:42:49
问题 I'm trying to use firebase functions to do maintenance of my database and storage. Basically remove some old entries from one ref/bucket to another after they expire. The database part works great. However, the storage part, not so much. Here's how I initialize everything in my code: var functions = require('firebase-functions'); var admin = require("firebase-admin"); var serviceAccount = require('./my-app-bla-bla.json'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount)

Firebase admin - get Google OAuth token

断了今生、忘了曾经 提交于 2020-07-10 10:26:27
问题 I have a web application where users can sign in with Google . To the sign-in process, I add a scope to be able to access Google Calendar. Now that the user is signed in, I would like to - in server-side - get their current Google access token in order to make a request and get a list of their events. Is there a way to get the current OAuth token (no need for refresh token) in order for me to make this completely on the server-side? 回答1: I'd say that you can check this article and put special

How can scheduled Firebase Cloud Messaging notifications be made outside of the Firebase Console?

纵然是瞬间 提交于 2020-07-09 11:54:09
问题 Inside the Firebase Console, under the Cloud Messaging view, users are able to create test notifications. This functionality also allows you to schedule the time at which the notification will send to a device or set of devices. Is it possible to create and send scheduled FCM notifications to specific devices by using firebase cloud functions and the Firebase Admin SDK? Is there an alternative way to solving this? The current way that I send scheduled messages to users is like so: const