3

I'm trying to deploy a build to Azure WebApp.

In Azure (http://manage.windowsazure.com) I linked the web app to my Visual Studio Online(VSTS) account.

In VSTS I've created a release definition with a single task (Azure Web App Deployment); the task is configured to use the endpoint defined in the administration module. The service endpoint is configured to use credentials. The credential is using a Microsoft account.

The release is failing with the below error:

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.

How can I setup the release to use a Microsoft account for Azure credential?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
ds19
  • 3,176
  • 15
  • 33
  • Are you getting this error only when you check in your code? Or do you also see it if you manually try to deploy to that endpoint? Also, have you been able to deploy web apps (even a blank sample app) in the past using the same account? – Shahed C - MSFT Dec 02 '15 at 19:06
  • It's the first time when I try to deploy from VSTS. I'm using only the manual release of the build. – ds19 Dec 03 '15 at 06:41

2 Answers2

6

There isn't any way to use a Microsoft Account Credential to connect to Azure from VSO service endpoint for now. You need to use an Organization account. If you don't have one, you can use "Certificate Based" authentication to connect to Azure easily. Click this link to get your subscription file and then paste the certification string in the subscription file into VSO "Management Certificate" area.

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
  • When I download a Publish Settings file, it does not contain a Management Certificate (it instead has username/password). I can't find any information on why this would be the case, so I'm currently stuck at this point. – Peder Rice Dec 06 '15 at 01:32
  • @PederRice Did you use the link I provided in the answer to get the subscription file? – Eddie Chen - MSFT Dec 07 '15 at 03:04
2

Add-AzureAccount cmdlet, uses Azure Active Directory (Azure AD) authentication access tokens and Azure AD uses Organizational Accounts.

Microsoft account credentials, formerly known as LiveIDs will not work in Azure AD authentication scenarios.

This is reported here as a suggestion and by design as of now:

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

Aram
  • 5,537
  • 2
  • 30
  • 41