I use visual studio to update all my environments with a certain migration. It had worked fine using the command below.
update-database -Migration initMigrat
According to EntityFrameworkCore#6846 the correct solution is to use the --environment option, the dotnet ef commands do not respect ASPNETCORE_ENVIRONMENT
--environment
dotnet ef
ASPNETCORE_ENVIRONMENT
dotnet ef database update --environment Production