简体   繁体   English

如何将 Azure AppSettings 传递给运行在 Linux AppService 上的 NodeJS App

[英]How to pass Azure AppSettings to NodeJS App running on Linux AppService

I am running a nestJS app on an Azure Linux AppService.我在 Azure Linux AppService 上运行 nestJS 应用程序。 I have added Application Settings within the appService, but I can't seem to get the app to pull through the value.我在 appService 中添加了应用程序设置,但我似乎无法让该应用程序获取该值。

one of the appSettings is process.env.DB_Host with value mysqlserveraddress but when the app starts it says it cannot connect to process.env.DB_Host rather than the mysqlserveraddress其中一个 appSettings 是process.env.DB_Host ,值为mysqlserveraddress但是当应用程序启动时,它说它无法连接到process.env.DB_Host而不是mysqlserveraddress

How do I pass these values in?我如何传递这些值?

Thanks谢谢

Tommy汤米

I am using below code to check the Environment Variable in my Linux App Service.我正在使用以下代码检查我的 Linux 应用服务中的Environment Variable

在此处输入图像描述

I can see the entire Environment variables which is available in my Linux App Service.我可以看到我的 Linux 应用服务中可用的整个Environment variables

And same I had added my App Settings in my Linux App Service.同样,我在我的 Linux 应用服务中添加了我的App Settings

在此处输入图像描述

在此处输入图像描述

Now I am specifically get the AppSettings Value in App.js and deployed in App Serive .现在我专门在App.js中获取AppSettings Value 并部署在App Serive中。

在此处输入图像描述

Now, I can get the Environments variable .现在,我可以获得Environments variable

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 nodejs linux 上启用 gzip 压缩 react Azure Web App with nginx - How do I enable gzip compression on a nodejs linux react Azure Web App with nginx 在 Azure 上使用 PM2 运行 nextjs 时出错 在 Linux 上应用服务 - Error running nextjs with PM2 on Azure App Service on Linux 如何查看 Azure 应用服务 web 应用的最终 appSettings 值? - How can I view the final appSettings values on an Azure App Service web app? 如何在 Azure 应用服务 (Linux) 上安装 ChromeDriver - How to install ChromeDriver on Azure app serveice (Linux) Azure Linux 带有 .Net Core Stack 的应用服务。 无法使用 NodeJS - Azure Linux App Service with .Net Core Stack. Unable to use NodeJS 如何远程调试运行在 Azure App Service 上的 java 应用程序 - How to remote debug a java application running on Azure App Service 在 Azure function 中使用 appsettings - Using appsettings in Azure function 如何在 Linux Azure Web App 上安装和配置 Oracle Instant Client - How to install and configure Oracle Instant Client on a Linux Azure Web App Azure 应用服务 linux 忽略自定义命令 - Azure app service linux custom command ignored ASP.NET 核心应用程序在尝试发布到 Azure 后不使用 appsettings.json 中的设置 - ASP.NET Core app does not use setting from the appsettings.json, after trying to publish to Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM