Dotnet test & publish running code analysis

We execute following steps in our AzureDevops pipeline in sequence.

  • Prepare Analysis

  • dotnet build

  • dotnet test

  • dotnet publish

  • Run Code Analysis

Our observation is that all the three dotnet build/test/publish commands are executing code analysis. This is not the case when we use MSBuild for full .net framework based solutions.
What are we missing here?