Overview of the custom connectors

In this Documentation we will discuss about how to create the custom connectors by using Azure Logic Apps, Microsoft Power Automate, and Microsoft Power Apps and Microsoft offer the over 1,000 connectors to connect to Microsoft and verified services, you might want to communicate with services that aren’t available as prebuilt connectors. Custom connectors address this scenario by allowing you to create (and even share) a connector with its own triggers and actions. 

Lifecycle of the Custom Connectors: –

 

 

1.Build and secure Custom API: – 

A custom connector is a wrapper around a REST API that allows Logic Apps, Power Automate, or Power Apps to communicate with that REST or SOAP API. 

REST API:  

A REST API (also called a RESTful API or RESTful web API) is an application programming interface (API) that conforms to the design principles of the representational state transfer (REST) architectural style. 

SOAP API: – 

SOAP API, or simple object access protocol application programming interface, is a standard messaging protocol that operating systems use to communicate via Hypertext Transfer Protocol (HTTP) and Extensible Markup Language (XML). 

Public: – (visible on the public internet) such as Spotify, Slack, Rackspace, or an API you manage. 

Private: – (visible only to your network). 

Logic Apps also support SOAP APIs. 

For public APIs that you plan to create and manage, consider using one of these Microsoft Azure products: 

1.Azure Functions. 

2.Azure web Apps. 

3.Azure API Apps. 

For private APIs, Microsoft offers on-premises data connectivity through 

on-premises data gateway: – 

It acts as a bridge to provide quick and secure data transfer between on-premises data (data that isn’t in the cloud) and several Microsoft cloud services. These cloud services include Power BI, Power Apps, Power Automate, Azure Analysis Services, and Azure Logic Apps. By using a gateway, organizations can keep databases and other data sources on their on-premises networks, yet securely use that on-premises data in cloud services. 

  1. Secure your API: –

Use one of these standard authentication methods for your APIs and connectors (Microsoft Entra ID is recommended) 

  • Generic OAuth 2.0 
  • OAuth 2.0 for specific services, including Microsoft Entra ID, Dropbox, GitHub, and Salesforce 
  • Basic authentication 
  • API Key 

You can set up Microsoft Entra ID authentication for your API in the Azure portal, so you don’t have to implement authentication. Or you can require and enforce authentication in your API’s code. 

2.1. OAuth 2.0 

Newly created custom connectors that use OAuth 2.0 to authenticate automatically have a per connector redirect URI. Existing OAuth 2.0 connectors must be updated to use a per-connector redirect URI before February 17, 2024. 

  • If you created your custom connectors with the web interface, edit your custom connectors, go to the Security tab and check the box, update to unique redirect URL, and then save to enable the per connector redirect URI. 
  • If you created your custom connectors with multi-auth using the command line interface (CLI) tool, you need to update your connector using the CLI tool to set “redirectMode”: “GlobalPerConnector”. 
  • Once the custom connectors are updated to use the per-connector redirect URI either through the setting in the Security tab or using the CLI tool, you should remove the global redirect URI from your OAuth 2.0 apps. You should add the newly generated unique redirect URL to your OAuth 2.0 apps. 
  • We’ll enforce this update for existing OAuth 2.0 custom connectors starting on February 17, 2024. Any custom connector that hasn’t been updated to use a per connector redirect URI stops working for new connections and shows an error message to the user. 
  • To find out which custom connectors need an update to migrate to per connector redirect URL, you can create a simple flow that uses the Get Custom Connectors as Admin action of Power Apps for Admin connector and parse its result. The flow attached later in this article fetches all the custom connectors using the same. It then applies a filter condition on the connection parameter’s property to filter out non-Oauth custom connector, followed by another filter to select only connectors that don’t use the per connector unique redirect URL. Finally, it puts the selected custom connectors into an array variable initialized in the beginning of the flow and generates an HTML table showing the name and creator of those connectors. You can import this flow into your environment by importing this solution. You can extend the flow further by sending the HTML table as an email to yourself. or you can extend it to send emails to the connector creators directly and provide them with the names of the connector that needs to be updated.
  1. 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, Power Automate, or Power Apps can communicate with your API. The following approaches are supported: 

  An OpenAPI definition (formerly known as a Swagger file) 

  • Create a custom connector from an OpenAPI definition 
  • OpenAPI documentation 

 A Postman collection 

  • Create a Postman collection 
  • Create a custom connector from a Postman collection 
  • Postman documentation 

Start from scratch using the custom connector portal (Power Automate and Power Apps only) 

Create a custom connector from scratch
 
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, Power Automate, and Power Apps use OpenAPI to define connectors.  

  1. Use your connector in a Logic App, Power Automate, or Power Apps app

Custom connectors are used the same way prebuilt connectors are used. You need to create a connection to your API to use it to call any operations expose in your custom connector. 

Connectors created in Power Automate are available in Power Apps. Likewise, connectors created in Power Apps are available in Power Automate. This isn’t true for connectors created in Logic Apps. However, 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: 

  1. Share your connector

You can share your connector with users in your organization the same way that you share resources in Logic Apps, Power Automate, or Power Apps. Sharing is optional, but you might have scenarios where you want to share your connectors with other users. 

  1. Certify your connector

If you’d like to share your connector with all users of Logic Apps, Power Automate, and Power Apps, you can submit your connector for Microsoft certification. Microsoft reviews your connector, checks for technical and content compliance, and validates functionality. 

Tutorial 

The tutorial uses the Cognitive Services Text Analytics API. Microsoft already provides a connector for this API. It’s a good example for teaching the custom connector lifecycle and how custom connectors can support unique scenarios. 

Scenario 

The connector you build exposes the Text Analytics Sentiment operation, which returns the sentiment score (0.000 to 1.000) for the text input. 

 Prerequisites 

One of the following subscriptions: 

  • An Azure subscription (Logic Apps) 
  • Power Automate 
  • Power Apps 

 Basic understanding of how to create Logic Apps, Power Automate flows, or Power 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. To get an API key 

 Request an API key to try out the API. This doesn’t require an Azure subscription. 

 Add 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: 

Advanced guidance 

The tutorials and video in this section give you the required insight to leverage Power Platform connectors as part of your implementations. 

Tutorials 

The following tutorials provide more detail for specific custom connector scenarios: 

Extend an OpenAPI definition 

Create a Postman collection for a custom connector 

Authenticate with Microsoft Entra ID 

Create a connector for a web API 

Use a webhook as a trigger 

Create a Logic Apps SOAP API connector 

Virtual Network support 

When the connector is used in a Power Platform environment linked to a Virtual Network, limitations apply: 

  • When custom code is used: Limitations are explained in Write code in a custom connector. 
  • Custom connectors created before the environment was associated with a Virtual Network must be reserved. 

For any Help or Queries Contact us on info@crmonce.com or +91 8096556344