-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to deploy function with service account parameter #5224
Comments
Thanks @taeold 👍🏻 for creating this new issue |
@taeold In general, I would have expected to configure all config via params... For us, this is a blocking feature, as we no longer can supply the service account with the prefix: |
@taeold do you have some visibility about this issue ? |
@fgruchala Sorry for the silence. We are actively working on getting service account parametrizable and going through internal process to get the API approved. Will keep you all posted. |
WIP #5234 |
Huge thanks |
Any news here? I'm also unable to parameterize serviceAccount within runWith ... |
@taeold is something similar planned for the function region? |
@Hibrix-net @fgruchala I faced the same challenge. For now, I resorted to using the import { defineString } from 'firebase-functions/params';
import { setGlobalOptions } from 'firebase-functions/v2/options';
const gcpCloudRegionParam = defineString("DSQ_GCP_CLOUD_REGION")
setGlobalOptions({
region: [gcpCloudRegionParam],
serviceAccount: `cloud-run-functions@${process.env.GCLOUD_PROJECT}.iam.gserviceaccount.com`
}) |
Do you know if this is fixed now? I remember a PR from @taeold about it in the past, if I'm not mistaken. |
@IchordeDionysos not fixed. I just tried a few days ago and it didn't work. |
@stfsy but you can supply an Expression no? 🤔 Are you using functions v1 or v2? |
@IchordeDionysos yeah but an expression is not a param, I guess. I wrote a blog post about the issue yesterday: https://medium.com/@stfsy/different-service-accounts-for-firebase-functions-per-stage-e667db4059e4. Gist is the firebase-tools/src/deploy/functions/build.ts Lines 455 to 462 in eea3e22
Thus, when passing a param instead of a string value, the param expression will be used and not the value that could be. You can see in branch that was created for the PR this line was added to actually resolve the value of the firebase-tools/src/deploy/functions/build.ts Lines 451 to 458 in 568c7a1
I added this line to the current firebase-tools version and it works pretty fine. The whole refactoring that was started for the I am using v2 functions. |
23-Mar-2025This still does not work.
I am running into an issue where |
I'm trying using parameterized codebases but I have this failure :
In my code, I have this :
The
CF_SERVICE_ACCOUNT
is configured in myfunctions/.env.[default|preproduction|production]
like this :CF_SERVICE_ACCOUNT=cloud-functions-runner@<PROJECT_ID>.iam.gserviceaccount.com
Do you have an idea where I made a mistake ?
I upgraded to the latest Firebase tools CLI :
11.16.0
Originally posted by @fgruchala in firebase/firebase-functions#1275 (comment)
The text was updated successfully, but these errors were encountered: