<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx" -->

---
title: How to Use Google Cloud Secret Manager in Bruno | daily.dev
description: A step-by-step guide covers integrating Google Cloud Secret Manager with the Bruno API client, from configuring a service account and enabling the Secret...
canonical: https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Use Google Cloud Secret Manager in Bruno | daily.dev
og:description: A step-by-step guide covers integrating Google Cloud Secret Manager with the Bruno API client, from configuring a service account and enabling the Secret...
og:url: https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx
og:image: https://api.daily.dev/og/posts/aiXJOqkPx.png
og:image:alt: How to Use Google Cloud Secret Manager in Bruno
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Google Cloud Secret Manager in Bruno

**[Bruno Blog](https://daily.dev/sources/usebruno)** · [@devgancode](https://daily.dev/devgancode) · 11 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide covers integrating Google Cloud Secret Manager with the Bruno API client, from configuring a service account and enabling the Secret Manager API, to fetching secrets into an environment, referencing them in requests and scripts with the {{rowName.secretId}} syntax, and running collections with fetched secrets via the Bruno CLI using --secrets-env-file. It also covers the v4.0.0 move of secret manager config to Environment → External Secrets, the deprecated {{$secrets.name.keyname}} syntax, variable precedence rules, and current limits such as latest-version-only secrets and service-account-key-only authentication.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.usebruno.com/google-cloud-secret-manager-bruno>

## Questions this post answers

### How do I use Google Cloud Secret Manager secrets in Bruno API requests?

Configure a GCP service account with roles/secretmanager.viewer and roles/secretmanager.secretAccessor, add it once under Preferences > Secrets Manager, then attach it to an environment's External Secrets tab and click Fetch Secrets. Reference values in requests as {{rowName.secretId}}, or {{rowName.secretId.jsonKey}} for JSON payloads, e.g. {{staging.api-key}}.

_Teams wiring secret managers into API clients can track Bruno workflow changes like this on daily.dev._

### How do I access GCP secrets inside Bruno pre-request scripts?

Use bru.getSecretVar() with the same dotted path used in request fields, passed as a string, for example bru.getSecretVar('staging.api-key') or bru.getSecretVar('staging.db.password') for a JSON sub-key. The GCP account must be configured and secrets already fetched before the script runs, and names must match the environment row alias and GCP secret ID exactly.

_Developers scripting around secret managers can follow syntax updates like this via daily.dev._

### What changed with Bruno secrets manager configuration in version 4.0.0?

Starting with Bruno v4.0.0, secret manager configuration moved from Collection Settings to Environment → External Secrets. The older {{$secrets.name.keyname}} reference syntax is deprecated in favor of {{name.keyname}} but still resolves until the next major release, with an automatic migration tool for rewriting old references shipping in v4.2.0.

_Anyone upgrading Bruno collections can watch for breaking config changes like this on daily.dev._

## Similar posts on daily.dev

- [How to Share Bruno Collections: Git, Export, and Import](https://daily.dev/posts/how-to-share-bruno-collections-git-export-and-import-qz4ne3qtg) · Bruno Blog · 0 upvotes · 0 comments
- [GitLab Secrets Manager: Govern secrets like your code](https://daily.dev/posts/gitlab-secrets-manager-govern-secrets-like-your-code-n7cnbh8sf) · GitLab · 0 upvotes · 0 comments
- [How to create and manage secrets with Grafana Cloud Synthetic Monitoring](https://daily.dev/posts/how-to-create-and-manage-secrets-with-grafana-cloud-synthetic-monitoring-gbscohesz) · Grafana Labs · 0 upvotes · 0 comments
- [Store, Rotate And Recover Passwords And API Keys With Amazon Secrets Manager](https://daily.dev/posts/store-rotate-and-recover-passwords-and-api-keys-with-amazon-secrets-manager-nbyptzo61) · API Evangelist · 0 upvotes · 0 comments
- [Securing Your Gemini and Google API Keys](https://daily.dev/posts/securing-your-gemini-and-google-api-keys-wuztnigzg) · Google Cloud · 0 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#cicd](https://daily.dev/tags/cicd), [#secrets-management](https://daily.dev/tags/secrets-management)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Use Google Cloud Secret Manager in Bruno","url":"https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx"},"datePublished":"2026-09-10T15:30:08.731Z","dateModified":"2026-10-15T02:22:47.943Z","description":"A step-by-step guide covers integrating Google Cloud Secret Manager with the Bruno API client, from configuring a service account and enabling the Secret...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c1cd0f49cab181c6935594d3c2308308?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c1cd0f49cab181c6935594d3c2308308?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Bruno Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Ganesh Patil","url":"https://daily.dev/devgancode","image":"https://media.daily.dev/image/upload/s--YZDsshgS--/f_auto/v1723695126/avatars/avatar_DKBm9qlNzn7jbRNc8qWlD","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":60}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,cicd,secrets-management","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Bruno Blog","item":"https://daily.dev/sources/usebruno"},{"@type":"ListItem","position":3,"name":"How to Use Google Cloud Secret Manager in Bruno"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-use-google-cloud-secret-manager-in-bruno-aixjoqkpx#faq","mainEntity":[{"@type":"Question","name":"How do I use Google Cloud Secret Manager secrets in Bruno API requests?","acceptedAnswer":{"@type":"Answer","text":"Configure a GCP service account with roles/secretmanager.viewer and roles/secretmanager.secretAccessor, add it once under Preferences \u003e Secrets Manager, then attach it to an environment's External Secrets tab and click Fetch Secrets. Reference values in requests as {{rowName.secretId}}, or {{rowName.secretId.jsonKey}} for JSON payloads, e.g. {{staging.api-key}}. Teams wiring secret managers into API clients can track Bruno workflow changes like this on daily.dev."}},{"@type":"Question","name":"How do I access GCP secrets inside Bruno pre-request scripts?","acceptedAnswer":{"@type":"Answer","text":"Use bru.getSecretVar() with the same dotted path used in request fields, passed as a string, for example bru.getSecretVar('staging.api-key') or bru.getSecretVar('staging.db.password') for a JSON sub-key. The GCP account must be configured and secrets already fetched before the script runs, and names must match the environment row alias and GCP secret ID exactly. Developers scripting around secret managers can follow syntax updates like this via daily.dev."}},{"@type":"Question","name":"What changed with Bruno secrets manager configuration in version 4.0.0?","acceptedAnswer":{"@type":"Answer","text":"Starting with Bruno v4.0.0, secret manager configuration moved from Collection Settings to Environment → External Secrets. The older {{$secrets.name.keyname}} reference syntax is deprecated in favor of {{name.keyname}} but still resolves until the next major release, with an automatic migration tool for rewriting old references shipping in v4.2.0. Anyone upgrading Bruno collections can watch for breaking config changes like this on daily.dev."}}]}
```

