0

I have a App service spring web app (Not Azure spring Apps).

I created a connection string - SQLConnectionSTRING

This stackoverflow link gives some info but not an answer stackoverflow question

Code:

@Value("${connection:absent}")
private String connection ;

Result : absent

How can I read the connection string in my app ?

(Note: Attempt 1: System.getenv("SQLConnectionSTRING") also did not work

Attempt 2 : > addding this to application props connection=${SQLConnectionSTRING} won't build at all, so does not work

Attempt3 : @Autowired private Environment environment; environment.getProperty("SQLConnectionSTRING"); also not working)

1 Answer 1

0

I found the azures assumption in this blog blog

Now get with prefix SQLAZURECONNSTR_ works

String value = environment.getProperty("SQLAZURECONNSTR_SQLConnectionSTRING");

Type for connection string was SQLAzure

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.