This wired path should not relevant with the configuration of Azure app service deploy task or Azure portal (Just ensure the Physical path
value in Azure portal is site/wwwroot
).
I guess you were using Visual studio build task
to build your project, right? Because I faced the similar path structure if I use VSbuild
task to build my .net core
app. If yes, what the others told you is correct. This is the default action if you are using Visual studio build task
in Build pipeline.
Others have explained this in detail, also provided the corresponding solution. You can refer to this #1 for explanation of this default action. And check this #2 for work around.
Therefore I can safely assume that you are developing ASP.NET Core 3.0
app to be hosted in Ubuntu. Any .NET Core 3.0 (or later) application
means that you should rely on the dotnet build
instead of using
VSBuild.
Also you had stated that you will host the app on Ubuntu 18.x, then
you should also run the build on Azure DevOps agent that runs on
Ubuntu. This means you should only use dotnet build
in
DotNetCoreCLI@2
task, because VSBuild
task only runs on Windows
based agent, not Ubuntu and it is intended to compile .NET Framework
and other platform other than .NET Core.
So, to achieve what you want, here you need using dotnet build task to build your .net core 3.1
project.
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: PATH/TO/YOUR/Project.csproj
arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release