简体   繁体   English

我无法从我的 REACT 应用程序的 azure 应用程序服务配置中读取环境变量

[英]I am having trouble of reading environment variable from azure app service configuration for my REACT app

I have added my variable in azure app service configuration and try to read it from my react application the following way, but no luck.我在 azure 应用程序服务配置中添加了我的变量,并尝试通过以下方式从我的反应应用程序中读取它,但没有运气。 Can anyone save the day?谁能拯救这一天? 在此处输入图片说明

import React from 'react';
import './App.css';


function App() {
  console.log(process.env);
  return (
    <div className="App">
      <header className="App-header">
        <h1>{process.env.REACT_APP_TITLE}</h1>
      </header>
    </div>
  );
}

export default App;

This is my test code.这是我的测试代码。 I build project and deploy it in windows and linux.我构建项目并将其部署在 windows 和 linux 中。

I found it not works, it should be a bug.我发现它不起作用,它应该是一个错误。 You can raise a support ticket to confirm it .您可以提出支持票来确认

在此处输入图片说明

Below is my test result.下面是我的测试结果。

在此处输入图片说明

Related Posts:相关文章:

In express project, it works for me, I have tested it before.在快递项目中,它对我有用,我之前已经测试过。

Retrieve Azure environment variables in NodeJs 在 NodeJs 中检索 Azure 环境变量

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

相关问题 我无法从我的 REACT 应用程序中读取 azure 应用程序服务配置的环境变量 - I am unable to read environment variable from azure app service configuration from my REACT app 我在创建 React 应用程序时遇到问题 - I am having trouble with creating react app 我在Bluemix中启动节点应用程序时遇到问题 - I am having trouble starting my node app in Bluemix 我无法将我的应用程序连接到Mongo Atlas - I am having trouble connecting my app to Mongo Atlas 为什么我在使用 Prisma(React 应用程序)在 Mongo 中显示和删除时遇到问题? - Why am I having trouble displaying and deleting in Mongo using Prisma (React app)? 我在创建 React 应用程序时出错,可能是由于我的 react-scripts 中的问题 - I am having an error creating a react app in my probably due to an issue in my react-scripts 我在将Node应用程序部署到Heroku时遇到问题,我在哪里出错? - I am having trouble deploying a Node app to Heroku, where am I going wrong? Azure Service App 中未定义环境变量 - Environment Variables are undefined in Azure Service App 将环境变量从package.json传递到React应用 - Pass environment variable from package.json to React app Azure static web 应用程序环境变量 - Azure static web app environment variable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM