0
votes

I'm using MSBUILD to build a solution that only contains a ASP.NET Web Application project. This is the exact line that I used to do this,

msbuild webapp.sln /p:Configuration="Release" /p:DeployOnBuild=true

Now this builds a zip file containing the web package files but it is all contained within a really long folder structure. Now for a bit of context. I've got an app service in Azure that I was publishing my project to using the "Publish" feature in Visual Studio 2019. This published the files under the "wwwroot/Files" folder in Azure. Now the problem I have now is that when this zip file is deployed to my app service in Azure, my "wwwroot/Files" folder now contains the following folder structure,

\Content\C_C\Source Control Root\Version\Type\Workspace\Solution\Project\obj\Release\Package\PackageTmp\

Basically what was being published from within Visual Studio 2019 to the "wwwroot/Files" is now being published to "wwwroot/Files/Content/C_C/Source Control Root/Version/Type/Workspace/Solution/Project/obj/Release/Package/PackageTmp/".

I want to be able to mimic what was done before with the "Publish" feature in VS 2019 by creating a zip file of the web package files without it being nested in a really long folder structure. Is it possible to achieve this? If so how would this be done?

P.S I use the following Powershell script to deploy the zip file to Azure,

Publish-AzWebapp -ResourceGroupName $resgroup -Name $name -ArchivePath "C:/SomewhereLocal~\WebhookBot.zip"
1

1 Answers

1
votes

You might need Deploy your app to Azure App Service with a ZIP or WAR file.

Firstly, choose publish as folder in VS. enter image description here Click Publish, which will generate a folder with publish file like below. I compressed the content and named it MyWebApp.zip , which we will use it deploy to Azure app service later. enter image description here Follow the docs about deploy from ZIP file. enter image description here Check the file content in wwwroot: enter image description here