Azure App service Deploy fails with Error: 'credentials' cannot be null

Viewed 3761

I have a portal account, and a devlops account. Both happen to use the same login/password.

In the portal.azure.com, I have a working web service. Under the web services "deployment-Deployment center" I select azure repos, azure pipelines as the build provider, set master branch etc.

It created a pipeline in my devlops which worked, i.e. it did NuGet restore, build solution, test assemblies, publish symbols path, publish artifact.

Great.

But it did not deploy the new build.

Clicking on "releases" in pipleines in devops, it was trying to use "Azure web app deploy" and giving an error that msbuild doesnt use the right format or similar. So I changed it to "Azure App Service Deploy".

Now I get a new error: Error: 'credentials' cannot be null.

There is no field for credentials.

It is using a publish profile.

Any ideas how I fix this?

here is the offending task:

enter image description here

There is no option to configure the missing credentials?

If I go to portal, and look at the "Deployment center", I see this:

enter image description here

If I click on "deployment credentials" I see this:

enter image description here

Which all looks good.

Any idea where the "null" credentials comes from?

3 Answers

Have you tried adding a new service connection in Project Settings and selecting Service Connections there? Even updating the Service connection created by Azure Portal threw an error for me.

The modal that pops up when you go to Project Settings/Pipelines/Service Connections and try to add a new service connection

In my case the issue was I did not have proper access rights to allow the connection between my pipeline and the Azure App. I was listed as a Contributor on the subscription. I contacted our company Devops and she updated the service connection without any issues because she was listed as an Owner or User Access Administrator.

Use "Azure Web App" task instead. Create a service connection using the publish profile route then use it within the task. Make sure you tick off "Deploy to Slot or App Service Environment" and it should work.

Related