I used to be able to deploy Cloud Functions for Firebase with a service account with this:
gcloud functions deploy MyFunction --service-account [email protected]
That now throws an error that it can’t find lib/index.js
. I’ve tried different paths in main:
in package.json
but nothing works. Any suggestions for fixing that error?
And is there a way to deploy Firebase Cloud Functions with an IAM service account? This doesn’t work:
firebase deploy --only functions:MyFunction --service-account [email protected]
2
Answers
I figured it out. The emulator requires a path to the service account key this way:
The cloud requires a path to the service account key this way:
I'll write a detailed answer tomorrow morning.
The Firebase CLI does not support this. You can think of the Firebase CLI as a simplified view of GCP services, and this is not part of the simplified view it exposes.
If you want to see a list of everything the CLI can do, find its reference documentation. You can also use
--help
on the command line to get help on any command to see what your choices are.