How to refer to other environment variable in Azure application settings

Anonymous
2023-10-09T13:05:34.21+00:00

Hi,

for my Payara based application (provided as Docker image) I need to set the JVM_ARGS environment value.

In there, I have to pass some passwords, see code below:

    "name": "JVM_ARGS",    "value": "-Xmx2048m -Djavax.net.ssl.keyStorePassword=$PAYARA_KEYSTORE_PASSWORD -Djavax.net.ssl.trustStorePassword=$PAYARA_TRUSTSTORE_PASSWORD ......",    "slotSetting": false  },

Are there any options to refer to another environment ($PAYARE_KEYSTORE_PASSWORD) variable here? Can I use template functions like "concat" or other operations here?

What other ways are recommended here to build up fields like

  • JVM_ARGS
  • connection URL´s
  • etc. ?

Thx for any hints,

Torsten

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,952 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2023-10-12T03:18:03.4566667+00:00

    Hi @Anonymous

    App settings get injected into the process as an environment variable as a literal value, so there isn't a way to refer to another setting. I don't know much about Payara but if it's possible to construct the connection string through runtime, then you can separate the connection string as separate settings and segment them together on container (app) startup.

    If you can't do that and the main concern is avoid storing the password in plain text as an app setting, then one option could be using a key vault value reference.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.