Search code examples
dockerblazorblazor-server-sideblazor-client-sideasp.net-blazor

How do i deploy a blazor docker container application to multiple environments?


I've got a blazor server and client side application that is deployed into a docker container. I have multiple appsettings.json files. Each file should be deployed with its corresponding environment

configuration files

I've seen some discussions which assert that the ASPNETCORE_ENVIRONMENT needs to be set for the server side application, which would automatically set the same value for the client side application. I've tried this. However, it seems that for the dev environment example, the appsettings.json file is still being used. I get a sign in error on the deployed dev environment which indicates that it's still using the appsettings.json file.

thanks


Solution

  • This was happening because we incorrectly set the ASPNETCORE_ENVIRONMENT correctly in the server application. Once we did that, it worked.