有没有一种方法可以触发"http触发器"?天蓝色功能,部署ARM模板后?

编程入门 行业动态 更新时间:2024-10-20 13:48:02
本文介绍了有没有一种方法可以触发"http触发器"?天蓝色功能,部署ARM模板后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有部署kubernetes集群和httptrigger函数应用程序的ARM.在httptrigger func内部,我有kubernetes的客户端,如果我手动触发此func,它会执行一些操作,它的工作正常.但是我需要在完成ARM部署后自动运行此触发器.

I have ARM who deploy kubernetes cluster and httptrigger function app. Inside httptrigger func I have client for kubernetes who do some action if I trigger this func manually, its work fine. But I need run this trigger automatically after deploy ARM was finished.

推荐答案

可以通过ARM本身,Azure DevOps管道或用于执行模板的任何协调器来发送触发Azure功能的HTTP请求.Terraform可以直接执行脚本;除非您真的想使用ARM,否则可能是一个选择.

The HTTP request that triggers the Azure Function may be sent either by ARM itself, or by the Azure DevOps pipeline or whatever orchestrator you use to execute the template. Terraform can execute scripts directly; unless you really want to use ARM, it might be an option.

如果要使用ARM,则至少有三个选择:

If you want to go with ARM, there are at least three options:

  • 使Azure函数返回空" ARM模板,并通过请求嵌套部署模板来触发它. blog.cloudtrooper/2017/04/04/run-azure-functions-from-your-quickstart-arm-templates/
  • 使用 Azure容器实例在Azure的独立容器中启动容器映像的实例,并在其中执行任意命令. samcogan/run-scripts-in-arm-deployments-with-aci/
  • 使用部署脚本资源(Microsoft.Resources/deploymentScripts).它基本上是对使用Azure容器实例的方法的内置支持.目前处于预览阶段,API版本为2019-10-01-preview. dev.到/omiossec/arm-template-what-s-new-for-2020-4kli#deployementsscripts-resource-provider
  • Make the Azure Function return an "empty" ARM template and trigger it by a request for nested deployment template. blog.cloudtrooper/2017/04/04/run-azure-functions-from-your-quickstart-arm-templates/
  • Use Azure Container Instances to launch an instance of a container image in a stand-alone container in Azure and execute an arbitrary command inside. samcogan/run-scripts-in-arm-deployments-with-aci/
  • Use the deployment scripts resource (Microsoft.Resources/deploymentScripts). It is basically a built-in support for the approach using Azure Container Instances. It's in preview, currently, API version 2019-10-01-preview. dev.to/omiossec/arm-template-what-s-new-for-2020-4kli#deployementsscripts-resource-provider
  • 在任何情况下,您都需要通过属性设置dependsOn引用,以便在正确的时间发送请求.

    In any case, you will need to property set up the dependsOn references so that the request is sent at the right time.

    更多推荐

    有没有一种方法可以触发"http触发器"?天蓝色功能,部署ARM模板后?

    本文发布于:2023-10-14 22:14:15,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1492368.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:触发器   天蓝色   模板   功能   方法

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!