0

I've a two web application (php and angular) hosted on azure web app with two slots (staging and production).

I want swap the two slots (usually from a staging slot into the production slot) . but when i do the swap , the production swap will keep the variable of staging slot ( if the staging point to a test database, when swap, the production slot will point to the test database)

So, any idea to externalize variables to make the application read the value from externaly ?

Thanks

Quentin Merlin
  • 664
  • 1
  • 6
  • 31

1 Answers1

1

Sorry for the misunderstanding and the delay, I found an answer for react app.

Like the React client side project, process.env cannot read any azure environment variables on Angular project.

I tested using .env file and env.js file, which all failed. Here is the article I was following, you could have a test: https://www.jvandemo.com/how-to-use-environment-variables-to-configure-your-angular-application-without-a-rebuild/

My last suggestion is hard-code and make several environmental files to match each of your environments.

For more information about the environmental file, see Environment Variables in Angular

Doris Lv
  • 3,083
  • 1
  • 5
  • 14