EDIT: If you are using a Dockerfile for deployments these are the steps you need to take to resolve this issue.
Change your Dockerfile to include the following:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
ENV PATH $PATH:/root/.dotnet/tools
RUN dotnet tool install -g dotnet-ef --version 3.1.1
Also change your dotnet ef
commands to be dotnet-ef