Q:

EF Migrations with Azure Pipeline Tasks

It appears to me that it's not straight forward to get migrations running with a yaml build pipeline with tasks because I'm getting the following error when I try and create a task that runs dotnet ef migrations.
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Linux, macOS, or Windows
Version      : 2.151.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
========================== Starting Command Output ===========================
##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work\_temp\a2cda363-57d3-416e-80ae-fb82a650ff74.ps1'"
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-ef does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
##[error]PowerShell exited with code '1'.
##[section]Finishing: Roll back migrations

On the build server, I have dotnet-ef installed globally.  So I'm not sure at this point why it's giving me this error.  Below is the yml script.
- task: PowerShell@2
  displayName: "Apply migrations"
  inputs:
    targetType: 'inline'
    script: |
      dotnet ef database update --project $(Build.SourcesDirectory)\DataLayer\DataLayer

A:

It turns out that it's a windows user issue.  dotnet core 3 no longer has dotnet-ef built into dotnet and I knew this and installed dotnet-ef as global but apparently doing that is user specific on a machine.  The dev that created the build pipeline needed to add dotnet-ef globally with their user on the same machine to get this working.  Hope this helps someone else in a collaborative environment.

