Microsoft Fabric’s data pipeline capabilities provide powerful tools for orchestrating and automating data workflows. While scheduled triggers are common for many scenarios, the ability to trigger pipelines programmatically via HTTP requests offers greater flexibility for event-driven architectures, integrations with external systems, and on-demand processing.

Lets learn How to Trigger Microsoft Fabric Pipelines Using HTTP Requests

Understanding HTTP Triggers in Microsoft Fabric

HTTP triggers allow you to start a pipeline execution by making a REST API call to a unique endpoint. This capability enables you to:

  • Integrate Fabric pipelines with external applications and services

  • Implement event-driven architectures where pipelines respond to specific events

  • Trigger pipelines on-demand from various platforms and technologies

  • Create complex orchestrations involving multiple systems

Prerequisites

Before implementing HTTP triggers for your Fabric pipelines, ensure you have:

  • A Microsoft Fabric workspace with appropriate permissions

  • An existing pipeline that you want to trigger via HTTP

  • Basic understanding of REST APIs and HTTP requests

  • A tool for testing HTTP requests (Postman, cURL, or PowerShell)

  • Authentication credentials (service principal or user credentials) with appropriate permissions


Step-by-Step Implementation

1. Create or Configure Your Fabric Pipeline

First, ensure your pipeline is properly configured in the Fabric workspace:

    • Sign in to the Microsoft Fabric portal.

    • Navigate to your workspace

    • Create a new pipeline or select an existing one

    • Design your pipeline activities as needed for your data processing requirements

    • Save the pipeline

2. Set Up the HTTP Trigger

To enable HTTP trigger capability for your pipeline:

    • In the pipeline editor, navigate to the “Trigger” tab

    • Select “Add Trigger” and choose “HTTP Trigger” from the dropdown menu

    • Configure the HTTP trigger settings:

      • Authentication Method: Specify the authentication mechanism (OAuth, Basic, etc.)

      • Permission Level: Set appropriate access controls

      • Allowed IP Ranges (Optional): Restrict access to specific IP addresses or ranges

    • Save the trigger configuration

Once saved, Fabric will generate a unique endpoint URL for your HTTP trigger. This URL will be used to initiate pipeline runs from external applications.

3. Obtain Authentication Credentials

To make authenticated calls to the HTTP trigger endpoint, you’ll need to set up appropriate credentials.

Using Service Principal (Recommended for Production)

    • In Azure Active Directory, register a new application

    • Generate a client secret or certificate for the application

    • Assign appropriate permissions to the service principal:

      • Navigate to your Fabric workspace

      • Access the “Access control” settings

      • Add the service principal with appropriate role (Contributor or higher)

Using User Credentials (For Testing)

While not recommended for production scenarios, you can use user credentials during development and testing.


4. Construct the HTTP Request

The HTTP request to trigger your pipeline will typically include:

POST https://{fabric-endpoint}/workspaces/{workspace-id}/pipelines/{pipeline-id}/triggers/http/invoke?api-version=2023-11-01
Content-Type: application/json
Authorization: Bearer {access-token}
{
“parameters”: {
“param1”: “value1”,
“param2”: “value2”
}
}

Key Components:

  • HTTP Method: POST

  • URL: The unique endpoint generated for your HTTP trigger

  • Headers:

    • Content-Type: application/json

    • Authorization: Bearer {access-token}

  • Body: JSON object containing any pipeline parameters


5. Obtain an Access Token

Before making the HTTP request, you need to obtain an access token.

Using Service Principal (PowerShell Example)

$tenantId = "your-tenant-id"


$clientId = "your-client-id"
$clientSecret = "your-client-secret"
$tokenEndpoint = “https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token”
$body = @{
client_id = $clientId
scope = “https://fabric.microsoft.com/.default”
client_secret = $clientSecret
grant_type = “client_credentials”
}

$response = Invoke-RestMethod -Method Post -Uri $tokenEndpoint -Body $body
$accessToken = $response.access_token

Using User Credentials with MSAL (C# Example)

var app = PublicClientApplicationBuilder
.Create(clientId)
.WithAuthority(AzureCloudInstance.AzurePublic, tenantId)
.WithRedirectUri("http://localhost")
.Build();
var result = await app.AcquireTokenInteractive(new[] { “https://fabric.microsoft.com/.default” })
.ExecuteAsync();

var accessToken = result.AccessToken;


6. Make the HTTP Request to Trigger the Pipeline

Using PowerShell

$pipelineEndpoint = "https://{fabric-endpoint}/workspaces/{workspace-id}/pipelines/{pipeline-id}/triggers/http/invoke?api-version=2023-11-01"
$headers = @{
"Content-Type" = "application/json"
"Authorization" = "Bearer $accessToken"
}
$body = @{
parameters = @{
param1 = "value1"
param2 = "value2"
}
}
ConvertTo-Json
$response = Invoke-RestMethod -Method Post -Uri $pipelineEndpoint -Headers $headers -Body $body

Using cURL

curl -X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
-d '{"parameters":{"param1":"value1","param2":"value2"}}'

"https://{fabric-endpoint}/workspaces/{workspace-id}/pipelines/{pipeline-id}/triggers/http/invoke?api-version=2023-11-01"


7. Monitor Pipeline Execution

After triggering the pipeline, you may want to monitor its execution:

  • The HTTP response will include a pipeline run ID

  • Use this ID to query the pipeline run status through the Fabric API or portal

  • Set up appropriate error handling and retry logic in your triggering application


Advanced Scenarios

Parameterized Pipeline Execution

{
"parameters": {
"sourceSystem": "CRM",
"dataDate": "2023-12-15",
"processType": "incremental"
}
}

Inside your pipeline, reference these parameters using

@pipeline().parameters.dataDate

 


Webhook Integration

  • Configure your external system (GitHub, ServiceNow, etc.) to send webhook events

  • Set up middleware to transform the webhook payload and trigger the Fabric pipeline

  • Pass relevant data from the webhook as pipeline parameters


Security Best Practices

  • Use Service Principals: Always use service principals with least privilege access

  • IP Restrictions: Limit access to specific IP addresses

  • Secure Secrets: Store authentication credentials in secure key vaults

  • Audit and Monitor: Enable logging and monitor for suspicious activities


Conclusion

HTTP triggers provide a powerful mechanism for integrating Microsoft Fabric pipelines with external systems and implementing event-driven data processing architectures.

By following the steps outlined in this article, you can successfully set up and use HTTP triggers to initiate pipeline executions programmatically, making your data pipelines more flexible and responsive to real-world events.

Apeksha Saraf
Author: Apeksha Saraf

Apeksha Saraf is an accomplished Full Stack BI Developer with 10 years of experience in designing and implementing end-to-end business intelligence solutions. At Orange Data Tech, she leverages her deep expertise in data analytics, visualization, and software development to transform complex data into actionable insights. Apeksha’s proficiency in both front-end and back-end development, combined with her innovative approach, enables her to deliver robust, scalable, and user-centric BI solutions. Her commitment to excellence and passion for empowering businesses with data-driven strategies make her an invaluable asset in driving digital transformation and informed decision-making.

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.