创建一个包含azure功能的逻辑应用程序,并使用CI/CD管道进行部署.2e [英] Create a logic app to include azure function and deploy using CI/CD pipeline.2e

查看:99
本文介绍了创建一个包含azure功能的逻辑应用程序,并使用CI/CD管道进行部署.2e的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始研究逻辑应用程序并设计了给定的工作流程:

因此,这里发生的事情是:当电子邮件到达我的收件箱时,它将接收电子邮件正文并将其传递给处理邮件的azure函数.

我已经使用Visual Studio 2019编写了一种Azure功能,并且能够进行部署.我还设法为天蓝色功能建立了CI/CD.

但是我正在azure门户中创建逻辑应用程序工作流并使用已部署的功能.我想知道这是否是个好方法?由于该逻辑应用程序使用了azure函数,因此我可以通过任何方式在VS中编写代码以将它们捆绑在一起,并且可以通过我一直在使用过azure函数的同一CI/CD管道同时部署两者.

但是我为什么要这样做?

  • 因为在测试时,我想监视测试电子邮件帐户的收件箱.但是想监视我的电子邮件帐户上线的时间.
  • 类似地,azure函数进行api调用,该调用将是在dev/test期间的一些testapi url和在运行时的实际url.

解决方案

与在门户网站中相比,我建议在VS中构建解决方案,因为这将提供更多的代码灵活性.

您可以在VS中使用以下选项之一.

第一个选项:一种解决方案,它将保存Azure功能项目,您可以在其他集成中继续使用它.如果可重用,则可以向其中添加更多的Azure功能项目.带有Azure逻辑应用程序的另一种解决方案.

第二个选项如果该功能特定于逻辑应用程序,则可以在同一功能中使用Azure函数和Azure逻辑应用程序项目创建一个解决方案.

1.Azure Function(已构建的功能)可以放置相同的功能,并使用CI/CD进行部署,并使其可用于逻辑应用程序.2.在一个单独的项目中使用Azure函数的Azure逻辑应用程序,它将使用Azure函数,您必须参数化Azure函数调用才能将其部署到逻辑应用程序中的多个环境中.

请注意,为了在逻辑应用程序中使用Azure功能,必须事先对其进行部署,因此在CI/CD中,您必须先部署Azure Function,然后才能部署Azure逻辑应用程序,以便可以使用它./p>

第三个选项:同一项目中可以同时具有Azure功能和逻辑应用程序,但是如果要使用链接模板,这将是理想的选择.除非遵循结构,否则这也可能会使项目在一段时间内变得无组织.

PS:这些链接可能有助于构建VS https://docs.microsoft.com/en-us/azure/logic-apps/manage-logic-apps-with-visual-studio 干杯!苏拉杰·雷万卡

I have just now started to explore the logic app and have designed the given workflow:

So what happens here is: When an email arrived in my inbox, it will take the email body and pass it to the azure function where it processes the email.

I have written an azure function using visual studio 2019 and able to delpoy. I have also managed to establish CI/CD for the azure function.

But I am creating a logic app workflow in the azure portal and using the deployed function. I am wondering if this is the good approach to do? Since, the logic app uses azure function, is there any way that I can write code in VS to bundle them together and may be deploy both at once via the same CI/CD pipeline which I have been using for the azure function.

But why would I want to do that ??

  • Because while testing I would like to monitor inbox of test email account. But would like to monitor my email account when it goes live.
  • Similarly azure function makes an api call which would be some testapi url during dev/test and actual url when it is live.

解决方案

I would recommend building solutions in VS than in portal, as that will give more code flexibilty.

You can use one of the below options in VS.

1st Option: One solution which will hold Azure Function Projects as you can resue it across other Integrations. You can add more Azure function Projects to it, if it is reusable. Another solution with Azure logic apps.

2nd option You can create one Solution with Azure Function and Azure logic app Projects in the same if the function is specific to the logic app.

1.Azure Function as you have already built you can place the same and make use of CI/CD for deployment and make it avaiable for the logic app. 2.Azure Logic App in a sepearte project which will consume the Azure function, you have to parameterise Azure Function call in order to deploy it for multiple environments within the logic app.

Please note in order to consume Azure function within logic app, it has to be deployed before hand so in CI/CD you would have to deploy Azure Function first and then you can deploy Azure logic app, so that it's accessible.

3rd Option: you can have both Azure function and logic apps in the same project, but this would be ideal if you want to make use of link-template. This might also make the project unorganised over the time unless the structure is been followed.

PS: these links might help to build in VS https://docs.microsoft.com/en-us/azure/logic-apps/manage-logic-apps-with-visual-studio Cheers! Suraj Revankar

这篇关于创建一个包含azure功能的逻辑应用程序,并使用CI/CD管道进行部署.2e的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆