we are about to migrate classic app insights of all 3 environment(dev, test and prod) to single workspace-based application insights, and noticed in application insights of all 3 environments(dev,test and prod) logs, the value of AspNetCoreEnvironment is production. we dont know based on what and where it is inserting/coming from.
is there any way to change this AspNetCoreEnvironment value by code wise or azure protal side, so we can categized the logs based on the environments.
By default, the value of AspNetCoreEnvironment
of the deployed App is Production
.
You can see the 2 deployment slots here. I have deployed my sample App to Staging and Production.
In Application Insights, you can see that even for the staging slot the Environment is shown as Production
.
If you want to change the value, it can be done from the Application Setting under Settings
=> Environment Variables
.
Add the setting for the particular deployment slot where you want to change the value.
Output after changing the value: