My *dotnetcore* app has one appsettings.json per environment (*appsettings.json* and *appsettings.Development.json* for example) and I would like to take advantage of this on my pipeline.

I see 2 options for the pipeline:

```
Build Artifact for Dev -> Deploy on Dev -> Build Artifact for Prod -> Deploy on Prod

```

or

```
Build Artifact -> Deploy on Dev -> Deploy on Prod

```

For the first option, I could set the environment as a parameter for the build.

For the second option, how could I build the App only once, and set the environment according to the current deployment step? Taking advantage of the multiple *appsettings.json* I have.

And finally, are these approaches aligned with the best practices? If not, what would be the best practices for pipelines with multiple environments?