0

I'm trying to deploy an Azure Function from an Azure DevOps repo via an DevOps pipeline and release. When it gets to the deploy stage I get an error message stating that the credentials can not be null, but knowhere in the canned release components is there a place for any credentials and none of my other pipelines ever have this problem.

I see some old references here but no clear answers.

Anyone have suggestions or fixes?

John S
  • 7,909
  • 21
  • 77
  • 145
  • Can you share the screenshots about the error page and the task definition of the step to deploy to Azure Function? This will help us understand this issue further. – Kevin Lu-MSFT Jan 05 '23 at 02:13

1 Answers1

2

Credentials cannot be null

I can reproduce this issue in my pipeline.

enter image description here

The cause of the issue is that you are using the Publish Profile type Azure Resource Manager Service Connection. And Azure Function App deploy task will not able to read the credentials of the Publish Profile type service connection.

Here are two methods to solve the issue:

1.You can change to use the Azure Web App task to deploy the Function APP.

For example:

enter image description here

Note: Azure Web APP task can be used to deploy to Web APP and Function App.

2.You can change the Service Connection type to Service Principal.

For example:

enter image description here

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28