Connectors and Custom Connectors

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 12 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Module: Design Automations

Section: Power Platform and AI Integration

Lesson: Connectors and Custom Connectors


Introduction: The Bridge Between Systems

In the landscape of modern business automation, the ability to move data from one application to another is the difference between a high-functioning digital ecosystem and a collection of isolated data silos. Power Platform provides a framework for this movement through a concept known as "Connectors." Think of a connector as a standardized interface or a digital translator that allows Power Automate, Power Apps, and Logic Apps to talk to external services like SQL Server, Salesforce, Twitter, or custom internal APIs.

Without connectors, developers would need to write thousands of lines of code to handle authentication, data serialization, error handling, and network requests for every single service they want to integrate. By using connectors, you abstract away that complexity. You simply tell the platform what you want to do—such as "get a row," "send an email," or "post a message"—and the connector handles the heavy lifting of communicating with the destination service.

This lesson explores how connectors function, how to build your own when the standard ones don't fit your needs, and how to integrate AI services into your workflows. Mastering these tools is essential for any professional looking to design automations that are both functional and maintainable.


Not read yet

Understanding the Connector Architecture

At its core, a connector is a wrapper around an API (Application Programming Interface). When you use a connector in Power Automate, you are essentially making an HTTP request to a remote server. The connector provides a user-friendly interface that maps the technical details of the API—such as endpoints, headers, and body parameters—into a visual form that a citizen developer or an IT professional can configure without needing to write custom code.

There are two primary categories of connectors:

  1. Standard Connectors: These are pre-built, maintained by Microsoft, and included in most Power Platform licenses. They cover common services like Office 365, SharePoint, OneDrive, and Google Drive.
  2. Premium Connectors: These require additional licensing because they connect to more complex services like SQL Server, Salesforce, Oracle, or custom-built enterprise applications.

Callout: Standard vs. Premium Connectors The distinction between standard and premium is primarily a licensing and complexity boundary. Standard connectors are designed for general productivity tasks and are included in basic plans. Premium connectors provide access to enterprise-grade data sources and require a Per-App or Per-User plan. Always check your licensing requirements before architecting a solution that relies on premium connectors to avoid unexpected costs.

How Connectors Work Under the Hood

When you add a connector action to a flow, the platform performs three main tasks:

  • Authentication: It manages the handshake process with the service. Whether it uses OAuth 2.0, API Keys, or Basic Authentication, the connector handles the token refresh and credential storage securely.
  • Metadata Discovery: It reads the OpenAPI (formerly Swagger) definition of the target service to understand which operations (actions and triggers) are available.
  • Request Execution: It formats your inputs (like the text of an email or the values of a database row) into the specific JSON format required by the API, sends the request, and parses the response back into a format the Power Platform can use in subsequent steps.

Not read yet

The Necessity of Custom Connectors

While Microsoft provides hundreds of pre-built connectors, you will inevitably encounter a situation where you need to connect to a legacy internal system, a niche SaaS platform, or a proprietary API that has no existing connector. This is where Custom Connectors come into play.

A custom connector is a user-defined wrapper around an API. It allows you to define your own actions and triggers. You essentially provide the metadata that Power Platform needs to understand how to interact with your specific service. Once defined, a custom connector behaves exactly like a native connector; it appears in the connector gallery, supports authentication, and can be used across multiple flows and apps.

Prerequisites for Building a Custom Connector

Before you start building, you must have the following:

  1. An API Documentation: You need to know the base URL, the authentication requirements, and the endpoint paths for the actions you want to perform.
  2. Access to the API: You must have a valid endpoint that you can test against, preferably in a development or sandbox environment.
  3. An OpenAPI Definition (Optional but Recommended): An OpenAPI file (JSON or YAML) is the industry standard for describing APIs. If you have this file, you can import it into the Power Platform to generate the connector automatically, saving significant time.

Not read yet

Step-by-Step: Creating Your First Custom Connector

Let’s walk through the manual process of creating a custom connector to connect to a hypothetical weather service API.

Phase 1: Define General Information

  1. Navigate to the Power Automate portal.
  2. Select Data > Custom Connectors from the left-hand navigation.
  3. Click New custom connector and choose Create from blank.
  4. Give your connector a name (e.g., "WeatherAPI_Connector").
  5. In the General tab, provide the Host URL (e.g., api.weather-service.com) and the Base URL (usually /v1).

Phase 2: Security Configuration

The security tab determines how you connect to the API.

  • No Authentication: Use only for public, open APIs.
  • API Key: Useful if the service expects a key in the header or query parameter.
  • OAuth 2.0: The most common and secure method for professional APIs. You will need a Client ID and Client Secret from your provider.

Phase 3: Defining Actions

This is where you define what your connector actually does.

  1. Click on the Definition tab and click New Action.
  2. Give the action a unique Summary and ID (e.g., GetCurrentWeather).
  3. Under the Request section, click Import from sample.
  4. Choose the HTTP verb (GET) and paste the URL (e.g., https://api.weather-service.com/v1/current).
  5. The platform will automatically parse the parameters. You can then edit these parameters to make them required or optional.

Phase 4: Testing

Once saved, navigate to the Test tab.

  1. Create a connection to your service.
  2. Select your new action (GetCurrentWeather).
  3. Click Test operation.
  4. Inspect the response. If you see a "200 OK" status, your connector is working correctly.

Tip: Use Postman for Validation Before building a custom connector, always test your API calls in Postman or a similar tool. If you can get the API to work there, you have the exact parameters, headers, and authentication logic needed to replicate it in the Power Platform custom connector wizard.


Not read yet

Integrating AI Services with Connectors

The power of the Platform truly shines when you integrate AI services. You can use standard connectors to reach out to AI models, such as Azure OpenAI, AI Builder, or cognitive services.

Practical Example: Sentiment Analysis on Customer Feedback

Imagine you want to automatically analyze the sentiment of incoming emails and route them to the appropriate department.

  1. Trigger: Use the "When a new email arrives" (Office 365 Outlook) trigger.
  2. Action: Use the "AI Builder" connector. Select the "Analyze sentiment" action.
  3. Input: Pass the Body content from the email trigger into the text parameter of the sentiment analysis action.
  4. Logic: Use a condition block. If the sentiment score is below 0.3 (negative), send an alert to the Customer Support manager via Microsoft Teams. If it is above 0.7 (positive), send a thank-you note.

This workflow demonstrates how connectors act as the "glue" between your data (email) and your intelligence (AI Builder). You don't need to know how the sentiment analysis model works; you only need to know how to feed it data and read its output.


Not read yet

Best Practices and Industry Standards

Working with connectors requires discipline to ensure your automations remain stable as your organization scales.

1. Use Service Principals for Authentication

When building enterprise-grade connectors, avoid using personal service accounts. If an employee leaves the company, their account will be deactivated, and all your automated workflows will break. Instead, use a Service Principal or a dedicated "Service Account" with limited permissions.

2. Implement Proper Error Handling

APIs are not infallible. They go down, they timeout, and they return errors. Never assume a connector action will always succeed.

  • Use the Configure Run After setting in Power Automate.
  • If a connector fails, set up a secondary path to send an email notification to the administrator or log the error to a SharePoint list or SQL database.

3. Versioning

When you update a custom connector, you might break existing flows. Always keep track of your connector versions. If you need to make a breaking change, create a new version of the connector rather than modifying the existing one.

4. Security of Data

Ensure that you are not passing sensitive information (like passwords or PII) through connector parameters that might be logged in the flow history. Use "Secure Inputs" and "Secure Outputs" settings in Power Automate for sensitive fields.

Warning: API Rate Limits Every API has a limit on how many requests it can handle per minute or per hour. If your flow runs every minute and hits an external API, you might trigger a "429 Too Many Requests" error. Always check the documentation of the service you are connecting to and implement throttling if necessary.


Not read yet

Comparing Connector Types

Feature Standard Connector Premium Connector Custom Connector
Licensing Included in base plan Requires Premium plan Requires Premium plan
Maintenance Microsoft managed Microsoft managed User managed
Complexity Low (Plug and play) Low (Plug and play) High (Requires API knowledge)
Flexibility Limited to defined actions Limited to defined actions Infinite (You define the API)

Common Pitfalls and How to Avoid Them

Pitfall 1: Hardcoding Values

A common mistake is hardcoding URLs, API keys, or environment-specific values directly into the connector definition.

  • Solution: Use Environment Variables. These allow you to store values that change between development, test, and production environments, ensuring your flows are portable.

Pitfall 2: Ignoring Connection References

When you move a solution from one environment to another, the connections often break because the new environment doesn't have the same connection ID.

  • Solution: Always use Connection References. These are objects that act as a bridge between the flow and the connection, allowing you to re-authenticate in the destination environment without editing the flow logic.

Pitfall 3: Over-reliance on "HTTP" Connector

Some developers skip custom connectors entirely and use the generic "HTTP" connector for everything. While powerful, the HTTP connector does not provide the same user experience as a custom connector. It doesn't show up in the gallery, it doesn't provide helpful parameter fields, and it makes debugging much harder for other team members. Use the HTTP connector only for quick, one-off tasks.


Not read yet

Deep Dive: Managing Custom Connector Lifecycle

As your organization grows, the number of custom connectors will likely increase. Managing them effectively is crucial to prevent "connector sprawl."

The "Center of Excellence" (CoE) Approach

If you are working in an enterprise, you should implement a governance strategy for custom connectors.

  1. Centralized Repository: Keep all OpenAPI definitions in a source control system like GitHub or Azure DevOps.
  2. Standardized Naming: Use a naming convention that indicates the purpose and the environment (e.g., Corp_Finance_ERP_Prod).
  3. Review Process: Before a custom connector is promoted to production, it should undergo a security and performance review to ensure it doesn't expose sensitive data or overwhelm the target system.

Debugging Connector Failures

When a connector fails, the Power Automate run history is your best friend.

  • Check the Input/Output: Click on the failed action to see exactly what data was sent and what the API returned.
  • Look for 401/403 Errors: These indicate authentication issues. Check your credentials or token expiration.
  • Look for 400/422 Errors: These indicate a schema mismatch. You are likely sending data in a format the API doesn't expect (e.g., a string instead of an integer).
  • Look for 500/503 Errors: These are server-side issues. Check the status of the external service.

Not read yet

Advanced Connector Concepts: Webhooks vs. Polling

When you design a connector, you need to decide how it receives data. There are two primary methods:

1. Polling

The Power Platform periodically asks the service, "Do you have any new data?" This happens on a set interval (e.g., every 5 minutes). This is easy to implement but can lead to delays in data processing and can increase the number of API calls, potentially hitting rate limits.

2. Webhooks

The service sends a notification to the Power Platform as soon as a new event occurs. This is real-time and efficient. However, it requires the target service to support "callback URLs." When you register a webhook, the Power Platform provides a URL that the external service calls whenever an event is triggered.

Callout: Choosing Between Polling and Webhooks Use Polling for simple, low-volume integrations where a few minutes of delay is acceptable. Use Webhooks for high-volume, time-sensitive integrations where real-time data is critical. If the target API does not support webhooks, you are forced to use polling, so always check the API documentation early in the design phase.


Not read yet

Practical Exercise: Integrating a Custom API

To solidify your understanding, let's look at the structure of an OpenAPI file that you might import for a custom connector. This file tells Power Platform exactly how to interact with your API.

openapi: 3.0.0
info:
  title: EmployeeDirectoryAPI
  version: 1.0.0
paths:
  /employees:
    get:
      summary: Get list of employees
      operationId: GetEmployees
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id: {type: integer}
                    name: {type: string}

When you import this YAML file into the Custom Connector wizard:

  1. The platform creates an action called GetEmployees.
  2. It automatically knows that the response will be an array of objects.
  3. It makes the id and name fields available as dynamic content in your flow, allowing you to use them in subsequent steps like "Send an email" or "Create a record in SharePoint."

This approach is far superior to manually configuring every parameter because it provides a "strongly-typed" experience. Your flow designer will get intellisense and validation, drastically reducing the chance of errors.


Not read yet

Key Takeaways for Success

Mastering connectors is a journey of understanding how different software systems communicate. By following these guidelines, you will build robust, scalable automations.

  1. Leverage Existing Connectors First: Always check the connector gallery before building a custom one. Microsoft updates these frequently, and the one you need might already exist.
  2. Prioritize Security: Never store credentials in plaintext. Use secure authentication methods like OAuth 2.0 and always use Service Principals for production-level automations.
  3. Design for Failure: Assume your connections will break. Use "Configure Run After" to build secondary paths for error logging and notifications.
  4. Governance is Key: Implement a process for managing custom connectors. Don't let individuals create dozens of duplicate connectors; centralize your efforts to maintain quality and security.
  5. Use OpenAPI Specifications: Whenever possible, use OpenAPI files to define your custom connectors. This ensures consistency, simplifies maintenance, and provides a better experience for other developers.
  6. Monitor API Limits: Be aware of the rate limits of the APIs you are connecting to. Design your flows to be efficient and avoid unnecessary polling.
  7. Document Your Work: A connector is only as useful as its documentation. Ensure that your custom actions have clear summaries, descriptions, and parameter labels so that anyone on your team can understand how to use them.

By following these principles, you move from being a simple user of the Power Platform to an architect of enterprise-grade automation systems. Connectors are the foundation of this work—treat them with the care and structure they deserve, and your automations will provide value to your organization for years to come.


Not read yet

Frequently Asked Questions (FAQ)

Q: Can I share a custom connector with my entire organization? A: Yes. Once you have created and saved a custom connector, you can share it with specific users or the entire organization. They will then be able to see it in their connector list and use it in their own flows and apps.

Q: What if the API I need to connect to doesn't have an OpenAPI definition? A: You can still build a custom connector by manually adding actions and parameters in the wizard. It takes longer and is more prone to error, but it is entirely possible. Many developers create the JSON/YAML file themselves to speed up the process.

Q: Are custom connectors free? A: The creation of the connector is free, but using them in a Power Automate flow or Power App generally requires a Premium license. Always consult the latest Microsoft licensing documentation, as these terms can change.

Q: How do I handle authentication tokens that expire? A: If you use OAuth 2.0, the Power Platform handles token refreshing automatically. You simply provide the Client ID and Secret when you create the connection, and the platform manages the lifecycle of the access token for you.

Q: Can I use a custom connector in a solution? A: Absolutely. In fact, you should always include custom connectors in Solutions. This ensures that they are bundled with your flows and apps, making deployment to different environments (Development, UAT, Production) much smoother.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.