Reputation: 311
I'm trying to deploy to gcp secrets stored as variables in azure devops.
But when I try the command
gcloud run deploy --update-secrets=myvar=$(myvar)
as stated in the official documentation gcloud run deploy --update-secrets=[KEY=VALUE,…]
, it throws this error:
ERROR: (gcloud.run.deploy) No secret version specified for myvar. Use myvar:latest to reference the latest version.
##[error]Cmd.exe exited with code '1'.
Given that the pipeline correctly recognizes $(myvar)
. And given that changing gcloud run deploy --update-secrets=myvar:latest=$(myvar)
won't give effects.
How should I release this secret? Thanks
Upvotes: 0
Views: 359
Reputation: 311
A thing that worked was running
gcloud run deploy --update-secrets = myvar=$(myvar):latest
Documentation is available here: https://cloud.google.com/run/docs/configuring/secrets#command-line
Upvotes: 0
Reputation: 2189
The square brackets are just indications that you can provide multiple values, separated by a comma.
So this should work:
gcloud run deploy --update-secrets="myvar=$(myvar)"
Upvotes: 1