Azure构建管道部署Azure函数应用:’credentials’ 不能为null

huangapple go评论84阅读模式
英文:

Azure Function App Deploy from Azure Build Pipeline: 'credentials' cannot be null

问题

我正在尝试在Azure DevOps中创建一个构建管道,以便在持续集成管道的一部分自动部署Azure函数应用程序。当运行函数应用部署步骤时,该步骤失败,显示错误信息'credentials'不能为null。

有人知道为什么会发生这种情况吗?

我的构建管道:

Azure构建管道部署Azure函数应用:’credentials’ 不能为null

步骤运行时的日志输出:

Azure构建管道部署Azure函数应用:’credentials’ 不能为null

我唯一认为可能导致问题的是Azure资源管理器订阅,我正在使用基于发布配置文件的身份验证。然而,我已经成功地为一个使用这种身份验证的Web应用程序创建了类似的管道。我只是无法部署函数应用程序。

英文:

I am trying to create a build pipeline in Azure DevOps to deploy an Azure Function Application automatically as part of a continous integration pipeline. When the Function App Deploy step is run, the step fails with 'credentials' cannot be null.

Does anyone know why this happens?

My Build Pipeline:

Azure构建管道部署Azure函数应用:’credentials’ 不能为null

The Log output when the step runs:

Azure构建管道部署Azure函数应用:’credentials’ 不能为null

The only thing that I think that it can be is the Azure Resource Manager subscription which I am using Publish Profile Based Authentication however I have managed to create a similar pipeline for a web application with a deploy option using this authentication and it worked successfully. I just cannot deploy the function application.

答案1

得分: 8

这个相同的问题在发布 Web 应用程序时也出现了。我发现有两个不同的任务可用于发布 Web 应用程序,您必须使用正确的任务。

有一个名为 Azure Web App Deploy 的任务可以正常工作。

也有一个名为 Azure App Service Deploy 的任务,不起作用。

这是基于发布配置文件的身份验证。

我发现要部署函数应用程序,您也可以使用 Azure Web App Deploy 任务,似乎可以正常工作。

英文:

This same problem also ocurrs with publishing web apps I found. There are two different tasks that can be used for web apps to publish and you have to use the right one.

There is a task called Azure Web App Deploy that works.

Azure构建管道部署Azure函数应用:’credentials’ 不能为null

Also a task called Azure App Service Deploy that doesn't.

Azure构建管道部署Azure函数应用:’credentials’ 不能为null

This is with Publish Profile Based Authentication.

I found that to deploy the Function Application you can also use the Azure Web App Deploy task and it seems to work.

答案2

得分: 0

关于这个问题的背景信息:

Azure Functions 任务将允许您选择 - 甚至创建 - 基于发布配置文件的服务连接。没有提供警告,但是根据代码来看,该任务未实现所需的发布配置文件的提取。

至少在选择服务时,任务应该警告您它不处理发布配置文件身份验证。最好的情况是,他们应该实现它。

对于这里的技术爱好者,更多细节。

对于需要使用发布配置文件身份验证的任务 - 例如 Web 应用程序部署 - 会发生类似于 此处 的情况:

if (Service Endpoint is Publish Profile) {
  publishProfileUtility.getSCMCredentialsFromPublishProfile();
}

查看链接以查看实际代码。

另一方面,Azure Functions 将简单地使用传递的端点创建服务,并希望一切顺利。

英文:

Just for a bit of context on this one.

The Azure Functions task will allow you to select - and even create - a Publish Profile based service connection. No warning is given, but - looking at the code - the task doesn't implement the needed fetching of the push profile.

At least the task - when selecting the service - should warn you that it doesn't handle Publish Profile authentication. At best they should implement it.

For the nerds in here, even more detail.

For tasks that work with Publish Profile authentication - like for example the Web App Deployment - you have something like this happening:

        if (Service Endpoint is Publish Profile) {
          publishProfileUtility.getSCMCredentialsFromPublishProfile();
        }

Look at the link for the actual code.

On the other hand the Azure Functions will simply create the service with the passed endpoint and hope for the best.

huangapple
  • 本文由 发表于 2020年1月3日 22:26:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/59580256.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定