Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
4 years agoexport specific secret value as an environment variable
Hello 1Password Community :)
I am trying to fetch and export a specific secret value as an environment variable:
what I tried: - Note that I replaced the actual gcp location with [gcp location]...
Former Member
4 years agoHmm let me make sure I understand the issue correctly:
When you run op item get --cache --format=json [gcp location], the [gcp location] part is, in fact, the name of your item, is this correct?
The issue here may be that this name contains the "/" character, which is not valid in secret references.
So, to reiterate, in order to create a valid secret reference, you would need:
1. the vault name or ID (Engineering, from the json output I see you provided above)
2. the item name or ID - if your item name contains unsupported characters, you can use the item ID, that you replaced above with "bla"
3. the field name or ID - secret, in your case
So I think a valid secret reference should be op://Engineering/<your-item-id>/secret.
Can you please let us know what does op read, given the above as an argument, return?
Thank you!
Best,
Horia