How to Cancel long Running Azure synapse pipeline programatically Via Pipeline it-self

Anonymous
2023-08-09T14:51:31.6133333+00:00

Hi

My Requirement is if Azure Synapse pipeline running more than 2.45 hrs. I need cancel that pipeline Automatically/Programmatically .How to achieve this

Via Pipeline it-self

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,859 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-08-10T05:28:50.6066667+00:00

    Normally it will complete by 2 hrs. some times due to network issues it is keep on running. So we need to Cancel programmatically not manually in Monitor UI .Do we have any Abort() or Stop ()built-ins command like informatica in Azure Synapse.

    1 person found this answer helpful.

  2. Nandan Hegde 32,026 Reputation points MVP
    2023-08-09T15:27:11.34+00:00

    Similar thread:

    https://stackoverflow.com/questions/69630913/cancel-synapse-pipeline-from-the-pipeline-itself#:~:text=NOTE%3A%20the%20REST%20API%20is,pipelines%20and%20then%20trigger%20them.

    you can use the REST API :

    https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/pipeline-run/cancel-pipeline-run?tabs=HTTP

    Updated Answer :

    You can follow the below flow to achieve the ask :

    1. at the end of the normal flow, have a set variable activity to assign a value to a variable w.r.t Pipeline status
    2. In parallel , have an until activity to validate whether the execution time has exceeded the timeout value or the pipeline has completed and accordingly, take the necessary actions.

    below blog explains it in detail : https://datasharkx.wordpress.com/2023/09/21/auto-cancel-long-running-pipelines-within-synapse-azure-data-factory/


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.