【发布时间】:2016-05-04 09:17:10
【问题描述】:
我有一个处理 Azure 队列中消息的简单应用程序。
public static void ProcessQueueMessage([QueueTrigger("myqueue")] string message, TextWriter log)
{
Console.WriteLine("QGot: " + message);
Console.WriteLine(string.Format("{0}: Completed: {1}", DateTime.Now, message));
}
我想将此应用程序多次部署到同一个 WebApp。我一直按照here 的步骤尝试将控制台应用程序部署为 WebJob。
我将以下 webjobs.props 添加到我的控制台应用程序项目中,并尝试使用 msbuild 进行部署,但遇到了一些身份验证问题:
<!--
<ManagementCertificate>MII...o=</ManagementCertificate>
<SubscriptionId>e0...af</SubscriptionId>
-->
<PublishSettingsPath>C:\Users\m\Downloads\VisualStudioPremiumwithMSDN-5-3-2016-credentials.publishsettings</PublishSettingsPath>
<SubscriptionId>e0...af</SubscriptionId>
</PropertyGroup>
</Target>
msbuild 命令:
C:\Users\m\Projects\ConsoleApp>msbuild ConsoleApp.csproj /p:PublishProfile="MultipleWebJobTestApp - Web Deploy" /p:DeployOnBuild=true
错误:
MSDeployPublish:
Start Web Deploy Publish the Application/package to https://multiplewebjobtestapp.scm.azurewebsites.net/msdeploy.axd?site=MultipleWebJobTestApp ...
Starting Web deployment task from source: manifest(C:\Users\m\Projects\ConsoleApp\obj\Debug\Package\DummyProvisioningApp.SourceManifest.xml) to Destination: auto().
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4283,5): msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. (Connected to the remote computer ("multiplewebjobtestapp.scm.azurewebsites.net") usi
ng the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more
at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.) [C:\Users\m\Projects\ConsoleApp\ConsoleApp.csproj]
Publish failed to deploy.
Done Building Project "C:\Users\m\Projects\ConsoleApp\ConsoleApp.csproj" (default targets) -- FAILED.
【问题讨论】:
-
我假设您没有编辑 PublishSettings 文件。您可以使用此发布设置文件通过 VS 中的右键单击发布选项进行发布吗?您是否尝试过重新下载发布设置文件?
-
您能找到解决方案吗?