0
votes

I have an ASP.NET MVC application and want to deploy it to Azure cloud service.

I have added Azure cloud service deployment task and trying to configure the subscription details using "New button". There are two fields which ask for user name and password. So I entered my credentials that I use to login to portal.azure.com. But I get an error during release process. Can you please help if I am missing anything?

2018-02-14T22:43:28.0976940Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM.Profile\2.1.0\AzureRM.Profile.psm1 -Global
2018-02-14T22:43:28.1499971Z ##[command]Add-AzureAccount -Credential System.Management.Automation.PSCredential
2018-02-14T22:43:31.8827701Z ##[error]AADSTS50079: The user is required to use multi-factor authentication.

Azure Classic subscription info

2

2 Answers

0
votes

The Azure classic portal has been retired, so you need to use the new portal and add Azure Resource Manager (Azure RM) service endpoint).

The simple way to add Azure RM service endpoint:

  1. Create a new build definition
  2. Add Azure App Service Deploy task, select the item in Available Azure subscription
  3. Click Authorize button

enter image description here

After that, it will add related service endpoint to your team project.

Another way is that, you can refer to this blog to add service endpoint:

Connect your Azure subscriptions to VSTS in 3 clicks

0
votes

You can create a set of deployment credentials that's different from your microsoft account's credentials.

Everything is pretty well explained here:

When you log into Microsoft Azure you are logging in with a Microsoft Account. This account lets you add, modify, and remove resources within your Azure subscription. Some Azure resources such as Websites and Mobile Services require a separate deployment credential to publish code. This separate deployment credential can be confusing and I wanted to document a few key points:

  1. The username you choose for the deployment credential must be unique across all Azure subscribers.
  2. The deployment credential you create is tied to your Microsoft account and is the same credential for all Azure resources which require a deployment credential.
  3. You do not want to share your deployment credential. Again, this credential has access to publish code to all Websites and Mobile Services that your Microsoft account can administer