通过DevOps Pipeline在Azure中的功能APP上检查功能
在Azure DevOps上,我有一个构建/部署YAML管道,该管道可以构建我的功能应用程序,并将其部署到Azure的Linux函数应用程序(在App-Service计划中托管)。
但是,最近我注意到了一个问题,该管道显示了该函数应用程序已成功部署,但是在Azure中进入功能应用并单击左侧的“功能”选项卡时,它显示了“无结果”,但是应该有4个函数在那里。
我想在部署管道的末尾有一个步骤,该步骤检查该功能应用中是否存在4个函数,并且如果不是这种情况,则在管道上运行。
我知道这很可能是使用Azure CLI或PowerShell的管道中的一项任务,但是不确定我将如何编写脚本。任何帮助将不胜感激。
谢谢大家,
On Azure DevOps I have a build/deploy YAML pipeline which builds my Function App and deploys this to a Linux Function App in Azure (hosted on an app-service plan).
However, recently I noticed an issue where the pipeline was showing the function app was successfully deployed, but when going into the FunctionApp in Azure and clicking on the Functions tab on the left, it shows "No results", but there should be 4 functions in there.
I want to have a step at the end of the deploy pipeline which checks that 4 functions exist in this FunctionApp, and to fail the pipeline run if this is not the case.
I know this will most likely be a task in the pipeline using Azure CLI or Powershell, but not sure how I would go around writing the script. Any help would be immensely appreciated.
Thanks all,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用Azure CLI任务,并致电REST API使用功能应用列出功能。我认为本地AZ CLI和Azure PowerShell函数不会在功能应用中揭示功能/
You could use an Azure CLI task and call the Rest API to list the functions withint the FunctionApp. I don't think the native Az CLI and Azure PowerShell functions expose the functions within the FunctionApp/
如果您有担忧,请告诉我。
If you have concerns, let me know.