Data Factory Pipeline, I want to Publish my trigger that I have created through a Http request, is this at all possible.

Clinton Morgan 20 Reputation points
2024-04-24T11:28:52.42+00:00

Hello,
I have created a Data Factory Pipeline with help from the below links using a HTTP Rest API call.
https://learn.microsoft.com/en-us/rest/api/datafactory/pipelines/create-or-update?view=rest-datafactory-2018-06-01&tabs=HTTP#code-try-0

https://learn.microsoft.com/en-us/rest/api/datafactory/triggers/create-or-update?view=rest-datafactory-2018-06-01&tabs=HTTP

https://learn.microsoft.com/en-us/rest/api/datafactory/triggers/start?view=rest-datafactory-2018-06-01&tabs=HTTP

I have then Created the Trigger and linked it to the Pipeline. I have then tried to start the Trigger, but keep getting the below error.

{
  "error": {
    "code": "BadRequest",
    "message": "Missing or invalid pipeline references for trigger nameoftrigger",
    "target": "nameoftrigger",
    "details": null
  }
}

If I go into Azure and to my Data Factory, Go to my triggers Start it manually then publish it, I can then manually stop it, go back to my API call and this time it will work.

Is there a way that I don't have to manually go and publish the trigger for the API calls to work.
As I will be creating multiple Pipelines and triggers and don't want to have to log on each time they are created.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
{count} votes

Accepted answer
  1. Eduardo Palomo Rodriguez 80 Reputation points Microsoft Employee
    2024-07-08T07:12:31.58+00:00

    Hello all, this problem occurs because the trigger body is not complete when you create the trigger via API call, the pipelineReference block lacks the field "type": "PipelineReferece". If you compare with the official documentation, you will see it there:
    https://learn.microsoft.com/en-us/rest/api/datafactory/triggers/create-or-update?view=rest-datafactory-2018-06-01&tabs=HTTP#triggers_create

    Your body:User's image

    Documentation:User's image

    The UI will auto-fix the code to ensure consistency but the fixed code is not applied till the user Publish (deploy the changes internally).

    To solve this problem, you only need to add that "type": "PipelineReferece" in your trigger body when creating the trigger via API, and you will be able to start it afterwards.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful