While the input is not directly defined for DotNetCoreCLI@2
DotNetCoreCLI@2
You can add:
--property:WarningAsError=true
to your list of arguments.
I found the list of valid properties for arguments here:
MS Build command-line reference
And it linked me here:
Common MS Build properties list