简体   繁体   中英

Azure Deployment Task Fails on Powershell Credential setting

I have a Visual Studio Team Services Build Definition to deploy an Asp.Net MVC application to Azure Web Site. I used the wizards to create my build definition so it is pretty vanilla implementation.

Most of the build goes well. The 'Get Source', 'Build Solution', 'Test Assemblies' tasks all pass. But the task for the 'Azure Deployment' is failing and it looks to me as though it is having problems with the PowerShell credentials.

The error stats :

AADSTS50034: To sign into this application the account must be added to the mydomain.org directory.

Since this is running in the cloud, I don't know what account it is trying to use so I am looking for some ideas how to get past this step.

Here is the output of the Azure Deployment task.

******************************************************************************
Starting task: Azure Deployment: http://superpoolsquares.azurewebsites.net
******************************************************************************
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\AzureWebPowerShellDeployment\1.0.23\Publish-AzureWebDeployment.ps1
Importing Azure Powershell module.
Importing AzureRM Powershell module.
AzurePSCmdletsVersion= 1.0.0
Get-ServiceEndpoint -Name edb1710a-25b3-4037-93b0-58c00f83c038 -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext
Username= ********
azureSubscriptionId= b4d2fa61-92ff-494a-9ff1-d1362895fc78
azureSubscriptionName= Visual Studio Professional with MSDN
Add-AzureAccount -Credential $psCredential

AADSTS50034: To sign into this application the account must be added to the mydomain.org directory.

Trace ID: 2cb051b9-6e76-4789-8a5d-e95a9486b731

Correlation ID: 22162659-23fa-4858-b957-9ccbf120654d

Timestamp: 2016-02-10 00:19:27Z: The remote server returned an error: (400) Bad Request.
Add-AzureRMAccount -Credential $psCredential

AADSTS50034: To sign into this application the account must be added to the mydomain.org directory.

Trace ID: ed10284e-87b6-4d45-8bd3-9ed1b25f4498

Correlation ID: 88960dea-0434-4eba-9f17-e4d6ceba1a41

Timestamp: 2016-02-10 00:20:21Z: The remote server returned an error: (400) Bad Request.

There was an error with the Azure credentials used for deployment.

It uses the account you configured on Service Endpoints dialog as following: 在此处输入图片说明 According to the error message, the account you use isn't been added to the mydomain.org directory which is the trusted AD by the subscription. So you need to add your account into that directory from Azure Portal and then try the deployment.

If you don't want make any change on Azure. You can use "Certificate Based" authentication when configure the connection. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM