Skip to content

Instantly share code, notes, and snippets.

@snobu
Created January 20, 2020 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snobu/169a5ad1e1ae07e0261f61438e86dca3 to your computer and use it in GitHub Desktop.
Save snobu/169a5ad1e1ae07e0261f61438e86dca3 to your computer and use it in GitHub Desktop.
keyvalult base64 encoded json as secret
$ cat secret.json | base64 > secret.json.base64
$ az keyvault secret set --vault-name alice --name secret-from-cli -f secret.json.base64
{
...
"tags": {
"file-encoding": "utf-8"
},
"value": "ewogICAgInRoaXMiOiAiaXMiLAogICAgInNvbWUiOiAianNvbiwKICAgICJtYXliZSI6IHsKICAgICAgICAieWVhaCI6IDEKICAgIH0KfQo=\n"
}
$ az keyvault secret show --vault-name alice --name secret-from-cli --query value -o tsv | base64 -d
{
"this": "is",
"some": "json,
"maybe": {
"yeah": 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment