2
votes

I've set up the release in Azure Devops to deploy a .net core 3.1 app to a Linux App Service in Azure. This seems to push the code to Azure, but to a really weird path:

Index of /wwwroot/Content/d_C/a/1/s/[MyProject]/obj/Release/netcoreapp3.1/PubTmp/Out/

This contains all the dlls and then a wwwroot directory which has all the files & folders found in my web project.

Here is my Release set up. Anyone have any ideas why my release isn't publishing to /home/site/wwwroot/? Others have said that this is where the site should be published to. Is there something I need to set up in the Azure portal or is this a Devops thing?

1
May I know does below method is work for you? Dose it make you achieve the wanted path in azure? Free to comment below if you still has any puzzle:-)Merlin Liang - MSFT

1 Answers

0
votes

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