exports.processMessage = onMessagePublished( messageTopic, { secrets: [ApiKey, Secret, sqlUsername, sqlPassword, sqlServerName] }, async (event) => {}
Basically I want to use secrets in an onMessagePublished(pub/sub) event. And in V2 functions they have to be on a dependency array
Hi @hmshimanyula,
Welcome and thank you for reaching out to our community.
I get that you wanted to use secrets for Pub/Sub topics (onMessagePublished event is triggered by messages published to a topic) but unfortunately it is not currently supported in Cloud Functions.
A good workaround to try is to configure secrets in Cloud Functions, then use Pub/Sub triggers to invoke that Cloud Function. Here are some useful resources for this use case:
Let me share with you as well some related topics from our community that can be of help:
You can also have this submitted as an issue or feature request or reach out to Cloud Functions Support for better assistance.