Skip to content

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

Merged
taeold merged 2 commits into
masterfrom
dl-sa-bugs
Mar 26, 2025
Merged

taeold merged 2 commits into
masterfrom
dl-sa-bugs

Conversation

@taeold

@taeold taeold commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

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
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