我可以仅使用SDK或Restful API创建逻辑应用程序吗? [英] Can I create a logic app using only SDK or Restful API?

查看:104
本文介绍了我可以仅使用SDK或Restful API创建逻辑应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您的阅读,并抱歉我的英语不好。 :)

Thank you for your reading and sorry for my poor English at first. :)

在研究了API文档和教程后,我对创建逻辑应用程序有疑问。

After studying the API document and tutorial, I have a question about logic app creation.

是否可以通过以下方式创建逻辑应用程序仅使用SDK或Rest API?

Is it possible to create a logic app by using SDK or Rest APIs only?

例如,如果我想使用像Slack这样的标准连接器,

For an example, if I want to use a standard connector like Slack,

我在门户网站上试过了我知道我需要做以下事情:

I tried that on portal and I know that I need to do the following things:

1。为OAuth创建一个api连接,

1. create an api connection for OAuth,

2。选择一个触发器

3。门户将通过使用来自Slack的令牌获取我的信息,然后我可以设置动态字段

3. portal will get my information by using token from Slack, and then I can set the dynamic fields

4。选择一个动作(只是一个例子,如果我仍然选择Slack)

4. select an action (just an example if I still choose Slack)

5。与步骤3相同,然后我可以微调我的行动

5. same as step 3, and then I can fine tune my action

我可以完全通过SDK或API执行上述步骤吗?当我使用SDK时,我想我可以创建一个工作流,但我找不到创建api连接的方法,并使用该连接获取我的个人信息来设置触发器和操作。是否可以或
我只能在天蓝门户网站上实现它?

Can I do above steps entirely by SDK or APIs? When I use the SDK, I think I can create a workflow but I cannot find a way to create an api connection and use that connection to get my personal information to setup the trigger and action. Is it possible or I can only achieve it on azure portal?

提前谢谢你。




推荐答案

实现Logic App自动化的最佳方法是使用  < a href ="https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-create-deploy-azure-resource-manager-templates#deploy-logic-apps-automatically"> ARM部署模板。 

用于创建API连接的示例模板格式:

Sample Template format to create a API Connection:

{
    "type": "Microsoft.Web/connections",
    "apiVersion": "2016-06-01",
    "location": "[resourceGroup().location]",
    "name": "{ConnectionName}",
    "properties": {
        "api": {
            "id": "[concat('subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/{Api}')]"
        },
        "displayName": "{DisplayName}",
        "parameterValues": { 
            "{ParameterValues}": "{ParameterValues}"
        }
    }
}

示例模板可以在
Github存储库
 (在浏览器中搜索逻辑应用程序 - >> Cntr + f)。

Sample Templates can be found here in Github repository (Search for logic-app in browser find --> Cntr+f).

这模板将创建您的Logic App工作流程和API连接,但是当您打开Logic Apps时,您必须通过输入服务凭据手动更新连接。

This templates will create Your Logic App workflow and API connection but when you open the Logic Apps, you will have to update manually the connection by entering your credentials for the service.

但如果您需要在不打开每个Logic Apps的情况下完成API连接创建,那么您可以使用此PowerShell脚本
LogicAppConnectionAuth 的。此脚本将检索OAuth Logic Apps连接器的连接的同意链接。然后它将打开同意链接并完成授权以启用
a连接。

But if you need to finalize the API Connection creation without opening every Logic Apps then you can use this PowerShell script LogicAppConnectionAuth. This script will retrieve a consent link for a connection for an OAuth Logic Apps connector. It will then open the consent link and complete authorization to enable a connection.

参考
此博客
了解详情。

Logic App Rest API文档


这篇关于我可以仅使用SDK或Restful API创建逻辑应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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