LoginSignup
1
0

More than 1 year has passed since last update.

Azure App Service for Java の Configuration は System.getEnv() で取得する

Last updated at Posted at 2020-11-01

Azure Web App のサービスで Javaベースのアプリを実行する際、Settings - Configuration から Application settings として Name - Value の組み合わせで値を保存することができる。

image.png

この値をアプリから取得するには System.getEnv() を利用する。

String serviceName = System.getenv("KEY_NAME");

システムプロパティ(System.getProperty()で取得)ではなくて環境変数(System.getenv()で取得)としてセットされるのがポイント。

以上です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0