/*****For Local setup****/
var isLocal = _configuration.GetValue<bool>("IsLocalEvn");
if (isLocal)
return isLocal;
This is always returning true even if the value in appsettings is false
From appsettings.json
"IsLocalEvn": "false",
>Solution :
You can use the boolean type inside the JSON file.
"IsLocalEvn": false,
In your case, you are using a string value which is interpreted as true when it’s converted to a boolean.