WebApp 部署到 Azure

WebApp deployment to Azure

我正在尝试将构建部署到 Azure WebApp。

在 Azure (http://manage.windowsazure.com) 中,我将 Web 应用程序链接到我的 Visual Studio 在线 (VSTS) 帐户。

在 VSTS 中,我创建了一个包含单个任务(Azure Web 应用程序部署)的发布定义;该任务配置为使用管理模块中定义的端点。服务端点配置为使用凭据。凭据正在使用 Microsoft 帐户。

发布失败并出现以下错误:

2015-12-02T18:17:35.4422685Z AzurePSCmdletsVersion= 0.9.8.1
2015-12-02T18:17:35.5692677Z Get-ServiceEndpoint -Name foo -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext
2015-12-02T18:19:07.5877546Z Username= ********
2015-12-02T18:19:07.5887893Z azureSubscriptionId= foo-foo-foo-foo-foo
2015-12-02T18:19:07.5907904Z azureSubscriptionName= Pay-As-You-Go
2015-12-02T18:19:07.6278127Z Add-AzureAccount -Credential $psCredential
2015-12-02T18:19:09.7755541Z ##[error]-Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account.
2015-12-02T18:19:09.9664413Z ##[error]There was an error with the Azure credentials used for deployment.

如何设置版本以使用 Microsoft 帐户作为 Azure 凭据?

Add-AzureAccount cmdlet,使用 Azure Active Directory (Azure AD) 身份验证访问令牌,而 Azure AD 使用组织帐户。

Microsoft 帐户凭据(以前称为 LiveID)在 Azure AD 身份验证方案中不起作用。

此处报告为建议和设计,截至目前:

https://github.com/Azure/azure-powershell/issues/477

目前无法使用 Microsoft 帐户凭据从 VSO 服务终结点连接到 Azure。您需要使用组织帐户。如果没有,可以使用 "Certificate Based" 身份验证轻松连接到 Azure。单击 this link 获取您的订阅文件,然后将订阅文件中的认证字符串粘贴到 VSO "Management Certificate" 区域。