Illegal characters in path error when composing and packaging an azure web application with a web job
I have a web application "WebApplication2" (Azure API) with a web job "WebJob1". I want to package an application along with a web job in a zip file to deploy the package to the cloud. When I do it with visual studio (Publish -> web deploy package) it works like a charm. But when I try to do it via MSBuild (for automation purposes) I get this error: Command:
C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild.exe "C:\Users\levs\Documents\Visual Studio 2015\Projects\WebApplication2\WebApplication2\WebApplication2.csproj" /p:OutputPath="C:\Users\levs\Documents\webPublish\MSBuildOutputPath" /p:DeployOnBuild=true /p:PackageLocation=C:\Users\levs\Documents\webPublish\test.zip /verbosity:m
Output:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(2606,5): error : Copying file C:\Users\levs\Documents\webPublish\MSBuildOutputPath**\*.* to obj\Debug\Package \PackageTmp\app_data\jobs\continuous\WebJob1\*.* failed. Illegal characters in path. [C:\Users\levs\Documents\Visual Studio 2015\Projects\WebApplication2\WebApplication2\WebApplication2.csproj]
Do you know what I am doing wrong?
BTW, compile each project (app and web app) separately with MSBuild.
MSBuild version: Microsoft (R) Build Engine version 14.0.25420.1
source to share
Not sure what you used to write automation scripts, but I had problems using MSBuild in Cake with my web work. Hope this can help anyone stumbling across the same issue.
My original paths during copying were as follows:
Copying C:\Test\Portal.WebApp\build\Package**\*.* to obj\Release\Package\PackageTmp\app_data\jobs\triggered\PortalWebJob\*.*
I believe with this part.
Package**\*.*
To fix this, I added a slash to the end of my OutputPath.
settings.WithProperty("OutputPath", MakeAbsolute(packageDir).ToString() + "/");
I felt like a fix, I know you might not be using Cake scripts, but hopefully this can get you back on track.
source to share