Related issues
[REQUIRED] Version info
Dart SDK:
Dart SDK version: 3.11.4 (stable) (Tue Mar 24 01:02:20 2026 -0700) on "macos_arm64"
firebase_functions (Dart package): 0.5.0
firebase_admin_sdk (Dart package): 0.5.0
firebase-tools (CLI): 15.15.0
[REQUIRED] Test case
import 'package:firebase_functions/firebase_functions.dart';
final githubWebhookSecret = defineSecret('GITHUB_WEBHOOK_SECRET');
Future<void> main(List<String> args) async {
await fireUp(args, (firebase) {
firebase.https.onRequest(
(request, response) async {
final secret = githubWebhookSecret.value();
response.send('OK');
},
name: 'myFunction',
options: HttpsOptions(
region: const DeployOption(SupportedRegion.asiaNortheast1),
secrets: [githubWebhookSecret],
),
);
});
}
[REQUIRED] Steps to reproduce
- Create a Dart Firebase Function using
firebase_functions: ^0.5.0
- Define a secret using
defineSecret('SECRET_NAME')
- Pass it to the
secrets parameter in HttpsOptions or CallableOptions
- Run
firebase deploy --only functions:dart
[REQUIRED] Expected behavior
The secret should be mounted as an environment variable on the Cloud Run service (similar to how it works for GCFv2 TypeScript functions), and the function should deploy successfully.
The firebase_functions Dart SDK already exposes defineSecret(), SecretParam, and the secrets option in HttpsOptions / CallableOptions, so the API surface implies this should work.
[REQUIRED] Actual behavior
Deployment fails with the following error:
Error: Tried to set secret environment variables on my-function[platform=run]. Only gcfv1, gcfv2 support secret environments.
The Firebase CLI recognizes the secret definitions from the compiled Dart spec but rejects them because Dart functions are deployed as Cloud Run services (platform=run), and the CLI's secret environment variable support is only implemented for gcfv1 and gcfv2 platforms.
Were you able to successfully deploy your functions?
No. Deployment fails at the validation step before any Cloud Run service is created or updated.
Workaround: Access Secret Manager directly at runtime using the REST API (bypassing defineSecret entirely). This works but loses the benefits of declarative secret management (automatic IAM binding, deploy-time validation, etc.).
Related issues
[REQUIRED] Version info
Dart SDK:
firebase_functions (Dart package):
0.5.0firebase_admin_sdk (Dart package):
0.5.0firebase-tools (CLI):
15.15.0[REQUIRED] Test case
[REQUIRED] Steps to reproduce
firebase_functions: ^0.5.0defineSecret('SECRET_NAME')secretsparameter inHttpsOptionsorCallableOptionsfirebase deploy --only functions:dart[REQUIRED] Expected behavior
The secret should be mounted as an environment variable on the Cloud Run service (similar to how it works for GCFv2 TypeScript functions), and the function should deploy successfully.
The
firebase_functionsDart SDK already exposesdefineSecret(),SecretParam, and thesecretsoption inHttpsOptions/CallableOptions, so the API surface implies this should work.[REQUIRED] Actual behavior
Deployment fails with the following error:
The Firebase CLI recognizes the secret definitions from the compiled Dart spec but rejects them because Dart functions are deployed as Cloud Run services (
platform=run), and the CLI's secret environment variable support is only implemented forgcfv1andgcfv2platforms.Were you able to successfully deploy your functions?
No. Deployment fails at the validation step before any Cloud Run service is created or updated.
Workaround: Access Secret Manager directly at runtime using the REST API (bypassing
defineSecretentirely). This works but loses the benefits of declarative secret management (automatic IAM binding, deploy-time validation, etc.).