Please explain in more detail what is wrong. Overriding app settings with environment variables works fine, for example, you can set the variable "ConnectionStrings:ConnectionString" and this value will be used as the connection string in the application, same for all other settings.
Please explain in more detail what is wrong. Overriding app settings with environment variables works fine, for example, you can set the variable "ConnectionStrings:ConnectionString" and this value will be used as the connection string in the application, same for all other settings.
How do we use environment variables? Do we create a nop_settings_json.env file and put our secrets like ConnectionString:ConnectinString?
nopCommerce will automatically populate the config from Env Variables as long as you follow the naming convention. How you manage those depends on the environment. Where are you hosting?
For local development in Visual Studio right click the Nop.Web project, select properties and go to the debug section. Open the debug launch profiles window and you can add env variables in there.
For production that depends on how you are hosting. I'm hosting in kubernetes and set mine in a deployment yaml file with token replacement on an automated deployment.
I am still a little bit confused since this isn't properly documented (I couldn't find any reference on how to setup environment variables on the nopCommerce docs). Where should this file be located and what is the naming convention? I do have a .env file but that doesn't work for me. My .env file is located on the root of the project.
I am still a little bit confused since this isn't properly documented (I couldn't find any reference on how to setup environment variables on the nopCommerce docs). Where should this file be located and what is the naming convention? I do have a .env file but that doesn't work for me. My .env file is located on the root of the project.
That's because you don't set that up in nop. Hence the "environment" part of the name. That is pulled from the environment. You set that up outside of nop.
Again - are you trying to make this work in dev or a production environment? Answering that will help us guide you better.
Hi, I am trying to use it on production. I will also be using docker with it, and deploy it on Azure.
So, what is your actual environment? A virtual machine (Windows or Linux)? Azure Web App? AKS? How are you planning to use Docker and what will you be deploying it on?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.