Skip to content

defineSecret creates a list of values in Secret ManagerΒ #1567

Closed
firebase/firebase-tools
#7422
@jtmuller5

Description

@jtmuller5

Related issues

[REQUIRED] Version info

node: v20.13.1

firebase-functions: ^5.0.0

firebase-tools:

firebase-admin: 13.9.0

[REQUIRED] Test case

Original Stack Overflow question: https://stackoverflow.com/a/78496117/12806961

[REQUIRED] Steps to reproduce

  1. Create a new Firebase Genkit project (firebase init genkit)
  2. export GOOGLE_GENAI_API_KEY={key}
  3. Add these lines at the top of the file:
import { defineSecret } from "firebase-functions/params";
defineSecret("GOOGLE_GENAI_API_KEY");
  1. Run firebase deploy --only functions
  2. Navigate to GCP > Cloud Functions > Functions > Select Function > Variables Tab

The GOOGLE_GENAI_API_KEY variable is a list, not a string.

[REQUIRED] Expected behavior

DefineSecret should create a single string environment variable and not a list with a single string value.

[REQUIRED] Actual behavior

image

Were you able to successfully deploy your functions?

Yes but it didn't work. I needed to change defineSecret to defineString.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions