Reputation: 6006
Am using TFS 2017 on-premise for building our code. I have used msbuild task with the following parameters.
/p:DeployOnBuild=true /p:AllowedReferenceRelatedFileExtensions=none /p:PublishProfile="$(Build.SourcesDirectory)\Source\PublishSettings\xxx.azurewebsites.net.publishsettings" /p:VisualStudioVersion=14.0 /p:Configuration=Release
Log:
2017-12-27T07:43:15.6823390Z Publish Pipeline Deploy phase Stage PipelineCopyAllFilesToOneFolderForMsdeploy
2017-12-27T07:43:15.6823390Z Package:
2017-12-27T07:43:15.6823390Z Invoking Web Deploy to generate the package with the following settings:
2017-12-27T07:43:15.6979640Z $(LocalIisVersion) is 0
2017-12-27T07:43:15.6979640Z $(DestinationIisVersion) is 0
2017-12-27T07:43:15.6979640Z $(UseIis) is True
2017-12-27T07:43:15.6979640Z $(IisUrl) is http://localhost:7372/
2017-12-27T07:43:15.6979640Z $(IncludeIisSettings) is False
2017-12-27T07:43:15.6979640Z $(_DeploymentUseIis) is False
2017-12-27T07:43:15.6979640Z $(DestinationUseIis) is False
2017-12-27T07:43:15.6979640Z GetMSDeployInstalledVersionPath:
2017-12-27T07:43:15.6979640Z $(_DefaultMSDeployMaxVersion) is 3
2017-12-27T07:43:15.6979640Z $(_MSDeployVersionsToTry) is 9.0
2017-12-27T07:43:15.6979640Z $(MSDeployPath) is C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\
2017-12-27T07:43:15.6979640Z GenerateMsdeployManifestFiles:
2017-12-27T07:43:15.6979640Z Generate source manifest file for Web Deploy package/publish ...
I got the below error.
The element <publishData> is unrecognized, or not supported in this context
I tested my publish setting which is downloaded from azure, it works perfectly fine with the visual studio deployment. My web api project is of .Net 4.6.1 .
Note: Only this project is not building properly, all other project of .Net 4.5.1 builds, perfectly fine in our on-premise tfs agent.
Upvotes: 1
Views: 1435
Reputation: 6006
I used the wpp files in my working project and now used the same wpp files in the new azure function project and it is all working now. What it really does is, it xmlpeeks
your publishsettings and makes a publish profile on the fly at msbuild runtime. You can find more details on implementations @ http://sedodream.com/2013/06/05/HowToPublishAVSWebProjectWithAPublishSettingsFile.aspx
Upvotes: 0
Reputation: 33698
The publishsettings file is used to generate publish profile file (Right click Project=> Publish=>Import), there isn’t <publishData>
section in publish profile, it is in publishsettings file.
So, generate publish profile file per to publishsettings file through VS and use it to publish web app.
There is an article about publish an Azure Web Site from the Command Line.
Upvotes: 1