Unity WebGL GitHub to Azure Continuous Deployment error MSB4019

Hi everyone!

First of all, let me know if I am posting this question in the wrong place, this is the best place I could find.

I’m trying to study different ways to publish one of my Unity projects in different places such as Itchio, GitHub, and Azure. I have successfully created one WebGL project that runs perfectly on all described websites with no need to change any building properties, which is great!

My problem started when I tried to use Azure continuous deployment with GitHub, with no need to hit publish in Visual Studio, the project should be deployed just by commiting to GitHub.
But whenever I commit to GitHub or try to re-run the workflow, I get this error:

Determining projects to restore…

[29]ColoRiseAzure/runs/3271068828#step:4:29) Nothing to do. None of the projects specified contain packages to restore.

[30]ColoRiseAzure/runs/3271068828#step:4:30)D:\a\ColoRiseAzure\ColoRiseAzure*ColoRise.csproj*(106,3): error MSB4019: The imported project “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\3.1.301\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets” was not found. Confirm that the expression in the Import declaration “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\3.1.301\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets” is correct, and that the file exists on disk.
(SOME LINKS I CANNOT POST - NEW USER)

ColoRise.csproj

(106,3): error MSB4019: The imported project “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\3.1.301\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets” was not found. Confirm that the expression in the Import declaration “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\3.1.301\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets” is correct, and that the file exists on disk.
(SOME LINKS I CANNOT POST - NEW USER)

I searched for a few days and have found many different solutions. Some regarding the web.config file and some about editing the .csproj file to add different paths and conditions to VSToolsPath but nothing seems to work, I always have the same type of error (MSB4019) but with different locations. I also tried different compressions (Gzip and Brotli) and no compression when building the game.

Some different options I tried:

<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildProgramFiles32)\MSBuild\Microsoft\VisualStudio\v14.0</VSToolsPath>

<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\MSBuild\Microsoft\VisualStudio\v14.0</VSToolsPath>

web.config

<?xml version="1.0"?>
<configuration>
  <system.webServer>
    <!--
     IIS does not provide default handlers for .data and .wasm files (and in some cases .json files),
     therefore these files won’t be served unless their mimeType is explicitly specified.
   -->
    <staticContent>
      <!--
       NOTE: IIS will throw an exception if a mimeType is specified multiple times for the same extension.
       To avoid possible conflicts with configurations that are already on the server, you should remove the mimeType for the corresponding extension using the <remove> element,
       before adding mimeType using the <mimeMap> element.
     -->
      <remove fileExtension=".data"/>
      <mimeMap fileExtension=".data" mimeType="application/octet-stream"/>
      <remove fileExtension=".wasm"/>
      <mimeMap fileExtension=".wasm" mimeType="application/wasm"/>
      <remove fileExtension=".symbols.json"/>
      <mimeMap fileExtension=".symbols.json" mimeType="application/octet-stream"/>
    </staticContent>
  </system.webServer>
  <system.web>
    <compilation debug="true"/>
  </system.web>
</configuration>

Azure deployment center properties

Unity Version: 2020.3.12f1
Unity Api Compatibility: .NET Standard 2.0
Visual Studio Version: 2019
I modified my Visual Studio Install and added:
Azure Development Workload.
.NET Portable Library

At this point I don’t know what is the problem, I’m afraid that this is as far as I understand.
Whenever I publish the project from Visual Studio everything works fine. Also I noticed that sometimes after commiting changes to the project, I receive an email from GitHub saying that some jobs were not successful even before the dotnet build step starts in the GitHub Actions page. I guess I’m having a problem with dotnet finding some sdks or libraries during the build?

Any help would be appreciated! Thank you!