was_777
was_777

Reputation: 711

Setting CF environment variable with multiline value

I want to set a RSA token in environment variable of CF App.

I try to set it with below commands

export var1=`cat key.pem`
cf set-env app KEY "$var1"

If I console the env variable(cf env app), I get the expected output:

.
.
User-Provided:
KEY: -----BEGIN RSA PRIVATE KEY-----
.
. multi-line key contents
.
-----END RSA PRIVATE KEY-----

However, if I run the app, it fails in the authentication.

I also tried applying quotes:

cf set-env app KEY "'$var1'"

Upvotes: 3

Views: 847

Answers (1)

was_777
was_777

Reputation: 711

It was the token issue. The first approach mentioned in the question worked.

Upvotes: 1

Related Questions