While Azure Logic Apps, Microsoft Flow, and PowerApps offer over 180+ connectors to connect to Microsoft and non-Microsoft services, you may want to communicate with services that are not available as prebuilt connectors. Custom connectors address this scenario by allowing you to to create (and even share) a connector with its own triggers and actions.
1. Build your API
A custom connector is a wrapper around a REST API (Logic Apps also supports SOAP APIs) that allows Logic Apps, Microsoft Flow, or PowerApps to communicate with that REST or SOAP API. These APIs can be:
- Public (visible on the public internet) such as Spotify, Slack, Rackspace, or an API you manage
- Private (visible only to your network)
For public APIs that you plan to create and manage, consider using one of these Microsoft Azure products:
For private APIs, Microsoft offers on-premises data connectivity through an on-premises data gateway. These gateways are supported by Logic Apps, Microsoft Flow, and PowerApps.
2. Secure your API
Use one of these standard authentication methods for your APIs and connectors (Azure Active Directory is recommended):
- Generic OAuth 2.0
- OAuth 2.0 for specific services, including Azure Active Directory (Azure AD), Dropbox, GitHub, and SalesForce
- Basic authentication
- API Key
You can set up Azure AD authentication for your API in the Azure portal so you do not have to implement authentication or you can require and enforce authentication in your API's code. For more information about Azure AD for custom connectors, see Secure your API and connector with Azure AD.
3. Describe the API and define the custom connector
Once you have an API with authenticated access, the next thing to do is to describe your API so that Logic Apps, Microsoft Flow, or PowerApps can communicate with your API. The following approaches are supported:
- An OpenAPI definition (formerly known as a Swagger file)
- A Postman collection
- Start from scratch using the custom connector portal (Microsoft Flow and PowerApps only)
OpenAPI definitions and Postman collections use different formats, but both are language-agnostic, machine-readable documents that describe your API. You can generate these documents from various tools based on the language and platform used by your API. Behind the scenes, Logic Apps, Flow, and PowerApps use OpenAPI to define connectors.
4. Use your connector in a Logic App, Flow, or PowerApps app
Custom connectors are used the same way Microsoft-managed connector are used. You will need to create a connection to your API and then you can use that connection to call any operations that you have exposed in your custom connector.
Connectors created in Microsoft Flow are available in PowerApps. Likewise, connectors created in PowerApps are available in Microsoft Flow. This is not true for connectors created in Logic Apps, but you can reuse the OpenAPI definition or Postman collection to recreate the connector in any of these services. For more information, see the appropriate tutorial:
- Use a custom connector from a flow
- Use a custom connector from an app
- Use a custom connector from a logic app
5. Share your connector
You can share your connector with users in your organization in the same way that you share resources in Logic Apps, Microsoft Flow, or PowerApps. Sharing is optional, but you may have scenarios where you want to share your connectors with other users.
For more information, see Share custom connectors in your organization.
6. Certify your connector
If you would like to share your connector with all users of Logic Apps, Microsoft Flow, and PowerApps, you can submit your connector for Microsoft certification. Microsoft will review your connector, check for technical and content compliance, and validates functionality.
For more information, see Submit your connectors for Microsoft certification.
The tutorial uses the Cognitive Services Text Analytics API. Microsoft already provides a connector for this API, but it is a good example for teaching the custom connector lifecycle and how custom connectors can support unique scenarios.
The connector you will build exposes the Text Analytics Sentiment operation which returns the sentiment score (0.000 to 1.000) for the text input.
- One of the following subscriptions:
- Basic understanding of how to create Logic Apps, Flows, or PowerApps apps
- API key for the Cognitive Services Text Analytics API
Get an API key
The Text Analytics API uses an API key to authenticate users. When a user creates a connection to the API through a custom connector, the user specifies the value of this key. You can get an API key by:
Requesting an API key to try out the API which does not require an Azure subscription
Adding the Text Analytics API to your Azure subscription. Once you have the API resource in your subscription, get the API key from the Keys section:
Start the tutorial
- If you are using Logic Apps, see:
- If you are using Microsoft Flow or PowerApps, see:
The following tutorials provide more detail for specific custom connector scenarios: