使用msbuild身份验证问题进行部署

时间:2016-05-04 09:17:11

标签: azure msbuild

我有一个简单的应用程序来处理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.

1 个答案:

答案 0 :(得分:0)

对于感兴趣的任何人,我都遇到了同样的问题并找到了解决方案。

问题是,我使用自定义发布配置文件从Visual Studio发布,而不是从Azure导入发布配置文件。

通过从Azure导入发布配置文件,并将该文档中的密码插入/ p:Password :,我可以对其进行修复

相关问题