Mike
Mike

Reputation: 391

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. Can anyone save the day?enter image description here

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;

Upvotes: 4

Views: 871

Answers (1)

Jason Pan
Jason Pan

Reputation: 21873

This is my test code. I build project and deploy it in windows and linux.

I found it not works, it should be a bug. You can raise a support ticket to confirm it.

enter image description here

Below is my test result.

enter image description here

Related Posts:

In express project, it works for me, I have tested it before.

Retrieve Azure environment variables in NodeJs

Upvotes: 1

Related Questions