Skip to content
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

Fix bug where shorthand notation and parameterized service account didn't work for functions #8366

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Mar 25, 2025

The change allows developers to set service account configuration using short notation (e.g. my-sa@) and using string parameters:

import { onRequest } from "firebase-functions/https";
import { defineString } from "firebase-functions/params";
import * as logger from "firebase-functions/logger";

const sa = defineString("SERVICE_ACCOUNT")

export const helloSAParams = onRequest(
  { serviceAccount: sa },
  (request, response) => {
    logger.info("Hello logs!", { structuredData: true });
    response.send("Hello from Firebase!");
  });

export const helloShorthand = onRequest(
  { serviceAccount: "firebase-app-hosting-compute@" },
  (request, response) => {
    logger.info("Hello logs!", { structuredData: true });
    response.send("Hello from Firebase!");
  });

fixes #5224, #8227

@taeold taeold requested review from Berlioz and inlined March 25, 2025 22:14
@taeold taeold merged commit 96d00aa into master Mar 26, 2025
49 checks passed
@taeold taeold deleted the dl-sa-bugs branch March 26, 2025 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to deploy function with service account parameter
2 participants