Azure and publish to the buildserver server. You must specify a physical directory for the virtual path

I get some strange errors on the build server during the CSPack stage when creating the Cloud Service project (web roles) to publish on the build server. Publishing through Visual Studio 2012 works fine, but not on the build server.

Error reported by Team City:

[Azure\AzureAPI\AzureAPI.ccproj.teamcity] CorePublish [15:58:49][CorePublish] CorePublish: PackageWebRole = True [15:58:49][CorePublish] Publishing starting... [15:58:49][CorePublish] RolePlugins is [15:58:49][CorePublish] Publishing to 'bin\Release\app.publish\' [15:58:49][CorePublish] MakeDir [15:58:49][CorePublish] TargetServiceDefinition is bin\Release\ServiceDefinition.csdef [15:58:49][CorePublish] TargetServiceConfiguration is bin\Release\ServiceConfiguration.cscfg [15:58:49][CorePublish] Roles is [15:58:49][CorePublish] CSPack [15:58:49][CSPack] D:\AzureAPI\bin\Release\ServiceDefinition.csdef error CloudServices077: Need to specify the physical directory for the virtual path 'Web/' of role Application.MyWebApi 

My ServiceDefinition file contains these parameters for the site.

 <WebRole name="Application.MyWebApi" vmsize="Small"> <Sites> <Site name="Web"> <Bindings> <Binding name="Endpoint1" endpointName="www" /> </Bindings> </Site> </Sites> ... </WebRole 

On the build server, I have "Azure Authoring Tools v2.0" and "Windows Azure Libraries for .NET 2.0."

Do I need to determine the physical path when publishing to the build server, or are there other scripts that might cause this error?

+8
azure teamcity azure-web-roles
source share
2 answers

I had the same problem, but I was able to fix it by adding additional properties to the "Command Line Properties" section during the build phase. The following additions did not allow me to show the error and were able to correctly generate my .cspkg file:

 /t:Publish /p:TargetProfile=Cloud /p:Configuration=Release /p:Platform="Any CPU" /p:PublishDir=bin\Release\app.publish /p:OutputPath=bin\Release 

In addition, I changed the Goals field to the following: publish

In my opinion, this means that /t:Publish is a command line property, but in any case, the error no longer appears in the assembly.

+3
source share

I had a similar problem while fighting CSPack. I eventually stumbled upon this MSDN article titled: Command-Line Build for Azure

I changed my MSBuild CMD to:

 WebAppPaaS\WebAppPaaS.sln /t:Publish /p:TargetProfile=Cloud 

Using MSBuild at:

 C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe 

This solved my build problems. Then I turned to Azure using PowerShell ...

+1
source share

All Articles