【问题标题】:Deploying with msbuild authentication problems部署 msbuild 身份验证问题
【发布时间】: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 中的右键单击发布选项进行发布吗?您是否尝试过重新下载发布设置文件?
  • 您能找到解决方案吗?

标签: azure msbuild


【解决方案1】:

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

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

通过从 Azure 导入发布配置文件,并将该文档中的密码插入 /p:Password:,我能够修复它

【讨论】:

    猜你喜欢
    • 2018-12-30
    • 2011-05-11
    • 1970-01-01
    • 1970-01-01
    • 2013-07-23
    • 2015-08-25
    • 2010-11-17
    • 2019-06-19
    相关资源
    最近更新 更多