适用于 Azure 逻辑应用的连接器Connectors for Azure Logic Apps

使用连接器可以从 Azure 逻辑应用快速访问其他应用、服务、系统、协议和平台上的事件、数据和操作。Connectors provide quick access from Azure Logic Apps to events, data, and actions across other apps, services, systems, protocols, and platforms. 使用逻辑应用中的连接器,可以扩展云中和本地应用的功能,以便对创建的数据和现有的数据执行任务。By using connectors in your logic apps, you expand the capabilities for your cloud and on-premises apps to perform tasks with the data that you create and already have.

虽然逻辑应用提供数百个连接器,但本文只介绍一些流行且较常用的连接器,数千个应用和数百万次执行已成功使用这些连接器来处理数据和信息。While Logic Apps offers hundreds of connectors, this article describes popular and more commonly used connectors that are successfully used by thousands of apps and millions of executions for processing data and information. 连接器以内置操作或托管连接器的形式提供。Connectors are available as either built-ins or managed connectors.

Note

若要与没有连接器的服务或 API 集成,可以通过 HTTP 等协议直接调用该服务,或创建自定义连接器To integrate with a service or API that doesn't have connector, you can either directly call the service over a protocol such as HTTP or create a custom connector.

连接器可用作内置触发器和操作,或用作托管的连接器:Connectors are available either as built-in triggers and actions or as managed connectors:

  • 内置操作:这些内置触发器和操作是 Azure 逻辑应用原有的,可帮助创建按自定义计划运行的逻辑应用、与其他终结点通信、接收和响应请求,以及调用 Azure 函数、Azure API 应用(Web 应用)、通过 Azure API 管理进行管理和发布的自有 API,和可以接收请求的嵌套逻辑应用。Built-ins: These built-in triggers and actions are "native" to Azure Logic Apps and help you create logic apps that run on custom schedules, communicate with other endpoints, receive and respond to requests, and call Azure functions, Azure API Apps (Web Apps), your own APIs managed and published with Azure API Management, and nested logic apps that can receive requests. 还可以使用内置操作来帮助组织和控制逻辑应用工作流及处理数据。You can also use built-in actions that help you organize and control your logic app's workflow, and also work with data.

  • 托管连接器:这些连接器提供触发器和操作用于访问其他服务与系统。Managed connectors: These connectors provide triggers and actions for accessing other services and systems. 某些连接器要求首先创建由 Azure 逻辑应用管理的连接。Some connectors require that you first create connections that are managed by Azure Logic Apps. 托管的连接器组织成以下组:Managed connectors are organized into these groups:

    托管的 API 连接器Managed API connectors 创建使用 Azure Blob 存储、Office 365、Dynamics、Power BI、OneDrive、Salesforce、SharePoint Online 等服务的逻辑应用。Create logic apps that use services such as Azure Blob Storage, Office 365, Dynamics, Power BI, OneDrive, Salesforce, SharePoint Online, and many more.
    本地连接器On-premises connectors 安装并设置本地数据网关后,这些连接器可以帮助逻辑应用访问 SQL Server、SharePoint Server、Oracle DB、文件共享等本地系统。After you install and set up the on-premises data gateway, these connectors help your logic apps access on-premises systems such as SQL Server, SharePoint Server, Oracle DB, file shares, and others.
    企业连接器Enterprise connectors 提供对 SAP 和 IBM MQ 等企业系统的访问,但会产生额外的费用。Provide access to enterprise systems such as SAP and IBM MQ for an additional cost.

    有关连接器的完整列表以及每个连接器的参考信息(例如按 OpenAPI(以前称为 Swagger)说明定义的操作和任何触发器以及任何限制),可以在连接器概述下找到完整列表。For the full list of connectors and each connector's reference information, such as actions and any triggers, which are defined by an OpenAPI (formerly Swagger) description, plus any limits, you can find the full list under the Connectors overview. 有关定价信息,请参阅逻辑应用定价模型逻辑应用定价详细信息For pricing information, see Logic Apps pricing model, and Logic Apps pricing details.

内置操作Built-ins

逻辑应用提供内置触发器和操作,因此你可以创建基于计划的工作流、帮助逻辑应用与其他应用和服务通信、通过逻辑应用控制工作流,以及管理或处理数据。Logic Apps provides built-in triggers and actions so you can create schedule-based workflows, help your logic apps communicate with other apps and services, control the workflow through your logic apps, and manage or manipulate data.

API 图标
计划
API icon
Schedule
- 使用“重复周期”触发器,按指定的计划以简单到复杂的重复方案运行逻辑应用。 - Run your logic app on a specified schedule, ranging from basic to complex recurrences, with the Recurrence trigger.

- 使用“延迟”操作,将逻辑应用暂停指定的持续时间。 - Pause your logic app for a specified duration with the Delay action.

- 使用“延迟截止时间”操作,将逻辑应用暂停到指定的日期和时间。 - Pause your logic app until the specified date and time with the Delay until action.

API 图标
HTTP
API icon
HTTP
使用适用于 HTTP、HTTP + Swagger 和 HTTP + Webhook 的触发器和操作,通过 HTTP 与任何终结点通信。Communicate with any endpoint over HTTP with both triggers and actions for HTTP, HTTP + Swagger, and HTTP + Webhook.
API 图标
请求
API icon
Request
- 使用“请求”触发器,使逻辑应用可从其他应用程序或服务调用、针对事件网格资源事件触发,或者针对 Azure 安全中心警报触发。 - Make your logic app callable from other apps or services, trigger on Event Grid resource events, or trigger on responses to Azure Security Center alerts with the Request trigger.

- 使用“响应”操作将响应发送到应用或服务。 - Send responses to an app or service with the Response action.

API 图标
批处理
API icon
Batch
- 使用“批处理消息”触发器来批量处理消息。 - Process messages in batches with the Batch messages trigger.

- 使用“发送要批量处理的消息”操作调用具有现有批处理触发器的逻辑应用。 - Call logic apps that have existing batch triggers with the Send messages to batch action.

API 图标
Azure Functions
API icon
Azure Functions
从逻辑应用调用运行自定义代码片段(C# 或 Node.js)的 Azure 函数。Call Azure functions that run custom code snippets (C# or Node.js) from your logic apps. API 图标
Azure API 管理
API icon
Azure API Management
调用可以使用 Azure API 管理进行管理和发布的自有 API 定义的触发器与操作。Call triggers and actions defined by your own APIs that you manage and publish with Azure API Management.
[API 图标[API icon
Azure 应用服务][azure-app-services-doc]Azure App Services][azure-app-services-doc]
调用 Azure 应用服务上托管的 Azure API 应用或 Web 应用。Call Azure API Apps, or Web Apps, hosted on Azure App Service. 包含 Swagger 后,这些应用定义的触发器和操作类似于其他任何第一类触发器和操作。The triggers and actions defined by these apps appear like any other first-class triggers and actions when Swagger is included. API 图标
Azure
逻辑应用
API icon
Azure
Logic Apps
调用使用“请求”触发器启动的其他逻辑应用。Call other logic apps that start with a Request trigger.

控制工作流Control workflow

逻辑应用提供用于在逻辑应用工作流中构建和控制操作的内置操作:Logic Apps provides built-in actions for structuring and controlling the actions in your logic app's workflow:

内置操作图标
条件
Built-in Icon
Condition
评估条件,并根据条件是 true 还是 false 运行不同的操作。Evaluate a condition and run different actions based on whether the condition is true or false. 内置操作图标
For each
Built-in Icon
For each
对数组中的每个项执行相同的操作。Perform the same actions on every item in an array. 内置操作图标
开关
Built-in Icon
Switch
将操作分组到案例,而案例分配有唯一的值(默认案例除外)。Group actions into cases, which are assigned unique values except for the default case. 仅运行其分配值与表达式、对象或令牌的结果相匹配的案例。Run only that case whose assigned value matches the result from an expression, object, or token. 如果不存在任何匹配项,则运行默认案例。If no matches exist, run the default case.
内置操作图标
终止
Built-in Icon
Terminate
停止当前正在运行的逻辑应用工作流。Stop an actively running logic app workflow. 内置操作图标
直到
Built-in Icon
Until
重复操作,直到指定的条件为 true 或某个状态发生更改。Repeat actions until the specified condition is true or some state has changed.

管理或处理数据Manage or manipulate data

逻辑应用提供用于处理数据输出及其格式的内置操作:Logic Apps provides built-in actions for working with data outputs and their formats:

“内置”图标
数据操作
Built-in Icon
Data Operations
对数据执行操作:Perform operations with data:

- 撰写:基于具有不同类型的多个输入创建单个输出。- Compose: Create a single output from multiple inputs with various types.
- 创建 CSV 表:基于包含 JSON 对象的数组创建逗号分隔值 (CSV) 表。- Create CSV table: Create a comma-separated-value (CSV) table from an array with JSON objects.
- 创建 HTML 表:基于包含 JSON 对象的数组创建一个 HTML 表。- Create HTML table: Create an HTML table from an array with JSON objects.
- 筛选数组:基于符合条件的另一个数组中的项创建一个数组。- Filter array: Create an array from items in another array that meet your criteria.
- 联接:基于数组中的所有项创建一个字符串,并使用指定的分隔符分隔这些项。- Join: Create a string from all items in an array and separate those items with the specified delimiter.
- 分析 JSON:基于 JSON 内容中的属性及其值创建用户友好的令牌,以便可以在工作流中使用这些属性。- Parse JSON: Create user-friendly tokens from properties and their values in JSON content so you can use those properties in your workflow.
- 选择:通过转换另一数组中的项或值并将这些项映射到指定的属性,创建包含 JSON 对象的数组。- Select: Create an array with JSON objects by transforming items or values in another array and mapping those items to specified properties.

内置操作图标Built-in Icon
日期时间Date Time
对时间戳执行操作:Perform operations with timestamps:

- 添加到时间:将指定的单位数添加到时间戳。- Add to time: Add the specified number of units to a timestamp.
- 转换时区:将时间戳从源时区转换为目标时区。- Convert time zone: Convert a timestamp from the source time zone to the target time zone.
- 当前时间:返回字符串形式的当前时间戳。- Current time: Return the current timestamp as a string.
- 获取将来的时间:返回当前时间戳加上指定的时间单位。- Get future time: Return the current timestamp plus the specified time units.
- 获取过去的时间:返回当前时间戳减去指定的时间单位。- Get past time: Return the current timestamp minus the specified time units.
- 从时间中减去:从时间戳中减去一定数目的时间单位。- Subtract from time: Subtract a number of time units from a timestamp.

“内置”图标
变量
Built-in Icon
Variables
对变量执行操作:Perform operations with variables:

- 追加到数组变量:插入一个值,作为变量存储的数组中的最后一个项。- Append to array variable: Insert a value as the last item in an array stored by a variable.
- 追加到字符串变量:插入一个值,作为变量存储的字符串中的最后一个字符。- Append to string variable: Insert a value as the last character in a string stored by a variable.
- 递减变量:按常量值减小变量。- Decrement variable: Decrease a variable by a constant value.
- 递增变量:按常量值增大变量。- Increment variable: Increase a variable by a constant value.
- 初始化变量:创建一个变量并声明其数据类型和初始值。- Initialize variable: Create a variable and declare its data type and initial value.
- 设置变量:将不同的值分配给现有变量。- Set variable: Assign a different value to an existing variable.

托管的 API 连接器Managed API connectors

逻辑应用提供以下用于自动化这些服务或系统的任务、流程和工作流的流行标准连接器:Logic Apps provides these popular Standard connectors for automating tasks, processes, and workflows with these services or systems.

API 图标
Azure 服务总线
API icon
Azure Service Bus
使用逻辑应用中最常用的连接器管理异步消息、会话和主题订阅。Manage asynchronous messages, sessions, and topic subscriptions with the most commonly used connector in Logic Apps. API 图标
SQL Server
API icon
SQL Server
连接到本地 SQL Server 或云中的 Azure SQL 数据库,以便可以管理记录、运行存储过程或执行查询。Connect to your SQL Server on premises or an Azure SQL Database in the cloud so you can manage records, run stored procedures, or perform queries.
API 图标
Office 365
Outlook
API icon
Office 365
Outlook
连接到 Office 365 电子邮件帐户,以便可以创建和管理电子邮件、任务、日历事件和会议、联系人、请求,等等。Connect to your Office 365 email account so you can create and manage emails, tasks, calendar events and meetings, contacts, requests, and more. API 图标
Azure Blob
存储
API icon
Azure Blob
Storage
连接到存储帐户,以便可以创建和管理 Blob 内容。Connect to your storage account so you can create and manage blob content.
API 图标
SFTP
API icon
SFTP
连接到可从 internet 访问的 SFTP 服务器,以便能够处理文件和文件夹。Connect to SFTP servers you can access from the internet so you can work with your files and folders. API 图标
FTP
API icon
FTP
连接到可从 internet 访问的 FTP 服务器,以便能够处理文件和文件夹。Connect to FTP servers you can access from the internet so you can work with your files and folders.
API 图标
Salesforce
API icon
Salesforce
连接到 Salesforce 帐户,以便能够创建和管理记录、作业、对象等项。Connect to your Salesforce account so you can create and manage items such as records, jobs, objects, and more. API 图标
Azure 事件中心
API icon
Azure Event Hubs
通过事件中心使用和发布事件。Consume and publish events through an Event Hub. 例如,通过事件中心获取逻辑应用的输出,然后将输出发送到实时分析提供程序。For example, get output from your logic app with Event Hubs, and then send that output to a real-time analytics provider.

本地连接器On-premises connectors

下面这些常用连接器提供对本地系统中数据和资源的访问。Here are some commonly used connectors that provide access to data and resources in on-premises systems. 在与本地系统建立连接之前,必须先下载、安装并设置本地数据网关Before you can create a connection to an on-premises system, you must first download, install, and set up an on-premises data gateway. 此网关提供安全信道,无需设置所需的网络基础结构。This gateway provides a secure communication channel without having to set up the necessary network infrastructure.

API 图标API icon
BizTalkBizTalk
服务器Server
API 图标API icon
MySQLMySQL
API 图标
Oracle DB
API icon
Oracle DB
API 图标API icon
PostgreSQLPostgreSQL
API 图标
SQL
Server
API icon
SQL
Server
API 图标API icon
TeradataTeradata

企业连接器Enterprise connectors

逻辑应用可以访问 SAP 和 IBM MQ 等企业系统:Your logic apps can access enterprise systems, such as SAP and IBM MQ:

API 图标
IBM MQ
API icon
IBM MQ
API 图标
SAP
API icon
SAP

有关触发器和操作的详细信息More about triggers and actions

某些连接器提供触发器,在发生特定事件时通知逻辑应用。Some connectors provide triggers that notify your logic app when specific events happen. 因此,在发生这些事件时,触发器将创建并运行逻辑应用的实例。So when these events happen, the trigger creates and runs an instance of your logic app. 例如,FTP 连接器提供“添加或修改文件时”触发器,用于在更新文件时启动逻辑应用。For example, the FTP connector provides a "When a file is added or modified" trigger that starts your logic app when a file gets updated.

逻辑应用提供以下类型的触发器:Logic Apps provides these kinds of triggers:

  • 轮询触发器:这些触发器以指定的频率轮询服务和检查新数据。Polling triggers: These triggers poll your service at a specified frequency and checks for new data.

    有新数据可用时,将创建逻辑应用的新实例,并使用作为输入传递的数据运行该实例。When new data is available, a new instance of your logic app gets created and runs with the data that's passed in as input.

  • 推送触发器:这些触发器侦听终结点上的新数据或要发生的事件,然后创建并运行逻辑应用的新实例。Push triggers: These triggers listen for new data at an endpoint or for an event to happen, which creates and runs new instance of your logic app.

  • 重复周期触发器:此触发器根据指定的计划创建并运行逻辑应用的实例。Recurrence trigger: This trigger creates and runs an instance of your logic app based on a specified schedule.

连接器还提供可在逻辑应用工作流中执行任务的操作。Connectors also provide actions that perform tasks in your logic app's workflow. 例如,逻辑应用可以读取数据,并在逻辑应用的后续步骤中使用此数据。For example, your logic app can read data and use this data in later steps of your logic app. 更具体地说,逻辑应用可以查找 SQL 数据库中的客户数据,然后在逻辑应用的工作流中处理此数据。More specifically, your logic app can find customer data from a SQL database, and process this data later in your logic app's workflow.

有关触发器和操作的详细信息,请参阅连接器概述For more about triggers and actions, see the Connectors overview.

自定义 API 和连接器Custom APIs and connectors

若要调用运行自定义代码或者无法作为连接器使用的 API,可以通过创建自定义 API 应用来扩展逻辑应用平台。To call APIs that run custom code or aren't available as connectors, you can extend the Logic Apps platform by creating custom API Apps. 还可以针对任何基于 REST 或 SOAP 的 API 创建自定义连接器,使这些 API 可供 Azure 订阅中的任何逻辑应用使用。You can also create custom connectors for any REST or SOAP-based APIs, which make those APIs available to any logic app in your Azure subscription.

获取支持Get support

  • 有关问题,请访问 Azure 逻辑应用论坛For questions, visit the Azure Logic Apps forum.

  • 若要提交或投票有关 Azure 逻辑应用和连接器的想法,请访问逻辑应用用户反馈站点To submit or vote on ideas for Azure Logic Apps and connectors, visit the Logic Apps user feedback site.

  • 文档中是否缺少你认为很重要的文章或详细信息?Are the docs missing articles or details you think are important? 如果是,你可以在现有文章中补充内容或编写自己的文章。If yes, you can help by adding to the existing articles or by writing your own. 我们的文档是开源的,托管在 GitHub 上。The documentation is open source and hosted on GitHub. 使用 Azure 文档的 GitHub 存储库入门。Get started at the Azure documentation's GitHub repository.

后续步骤Next steps