元素<publishdata>无法识别,或在此上下文中不受支持

时间:2017-09-21 07:10:59

标签: azure msdeploy msbuild-task msbuild-4.0

使用TFS 2017内部部署来构建我们的代码。我使用了以下参数的msbuild任务。

hduser@ubuntu:~$ python suncode/RatingsBreakdown.py -r hadoop --hadoop-streaming-jar /usr/local/hadoop/share/hadoop/tools/lib/hadoop-streaming-2.7.2.jar sundata/u.data

Using configs in /etc/mrjob.conf
Looking for hadoop binary in /usr/local/hadoop/bin...
Found hadoop binary: /usr/local/hadoop/bin/hadoop
Using Hadoop version 2.7.2
Creating temp directory /tmp/RatingsBreakdown.hduser.20170921.083051.964674
Copying local files to hdfs:///user/hduser/tmp/mrjob/RatingsBreakdown.hduser.20170921.083051.964674/files/...
Running step 1 of 1...
  session.id is deprecated. Instead, use dfs.metrics.session-id
  Initializing JVM Metrics with processName=JobTracker, sessionId=
  Cannot initialize JVM Metrics with processName=JobTracker, sessionId= - already initialized
  Cleaning up the staging area file:/app/hadoop/data/mapred/staging/hduser577870072/.staging/job_local577870072_0001
  Error launching job , bad input path : File does not exist: /app/hadoop/data/mapred/staging/hduser577870072/.staging/job_local577870072_0001/files/RatingsBreakdown.py#RatingsBreakdown.py
  Streaming Command Failed!
Attempting to fetch counters from logs...
Can't fetch history log; missing job ID
No counters found
Scanning logs for probable cause of failure...
Can't fetch history log; missing job ID
Can't fetch task logs; missing application ID
Step 1 of 1 failed: Command '['/usr/local/hadoop/bin/hadoop', 'jar', '/usr/local/hadoop/share/hadoop/tools/lib/hadoop-streaming-2.7.2.jar', '-files', 'hdfs:///user/hduser/tmp/mrjob/RatingsBreakdown.hduser.20170921.083051.964674/files/RatingsBreakdown.py#RatingsBreakdown.py,hdfs:///user/hduser/tmp/mrjob/RatingsBreakdown.hduser.20170921.083051.964674/files/mrjob.zip#mrjob.zip,hdfs:///user/hduser/tmp/mrjob/RatingsBreakdown.hduser.20170921.083051.964674/files/setup-wrapper.sh#setup-wrapper.sh', '-input', 'hdfs:///user/hduser/tmp/mrjob/RatingsBreakdown.hduser.20170921.083051.964674/files/u.data', '-output', 'hdfs:///user/hduser/tmp/mrjob/RatingsBreakdown.hduser.20170921.083051.964674/output', '-mapper', 'sh -ex setup-wrapper.sh python3 RatingsBreakdown.py --step-num=0 --mapper', '-reducer', 'sh -ex setup-wrapper.sh python3 RatingsBreakdown.py --step-num=0 --reducer']' returned non-zero exit status 512

enter image description here

记录:

/p:DeployOnBuild=true /p:AllowedReferenceRelatedFileExtensions=none /p:PublishProfile="$(Build.SourcesDirectory)\Source\PublishSettings\xxx.azurewebsites.net.publishsettings" /p:VisualStudioVersion=14.0  /p:Configuration=Release

我收到以下错误。

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 ...

我测试了我从azure下载的发布设置,它与visual studio部署完美配合。我的web api项目是.Net 4.6.1。

注意:只有这个项目没有正确构建,.Net 4.5.1的所有其他项目都在我们的内部部署tfs代理中完美地构建。

2 个答案:

答案 0 :(得分:1)

publishsettings文件用于生成发布配置文件(右键单击Project =&gt; Publish =&gt; Import),发布配置文件中没有<publishData>部分,它位于publishsettings文件中。

因此,通过VS为publishsettings文件生成发布配置文件,并使用它来发布Web应用程序。

有一篇关于publish an Azure Web Site from the Command Line的文章。

答案 1 :(得分:0)

我在工作项目中使用了wpp文件,现在在新的azure函数项目中使用了相同的wpp文件,现在一切正常。它真正做的是,xmlpeeks您的发布设置并在msbuild运行时动态发布配置文件。您可以找到有关实施@ http://sedodream.com/2013/06/05/HowToPublishAVSWebProjectWithAPublishSettingsFile.aspx

的更多详细信息