Reputation: 391
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?
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
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.
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
Upvotes: 1