Realm-cli, how to update secret from file

Hello. I’m trying to use secret on mongodb-realm to store my privatekey.pem. Unfortunately I haven’t found (or figured out) any convenient way to get secret uploaded to cloud. I can create secret with value like “test” and read it on my functions, but I need to get my RS256 privatekey.pem file uploaded.
realm-cli secrets update --name=“secret_name” --value=“test” obviously uploads value test. So, does anyone have any idea how to get contents of secret file stored? As far as I understand all arguments are pure strings.


find pretty ugly way to do this, but it’s simple. Just read your file and remove all new lines (\n) from secret. Copy this fixed secret to your clipboard. Then upload secret: realm-cli secrets update --value “paste secret”
When using this secret just add new line as shown KEY-----/n and /n-----END making it valid signing key again.


1 Like