Can't disable a scheduled pipeline endpoint

Bond Tran 1 Reputation point
2021-04-09T21:03:54.64+00:00

Hello,
I scheduled my pipeline to run weekly. Now I want to disable it. However, when I disable on Azure ML Studio, an error shows as below:

An error occurred while disabling pipeline
BadRequest: Cannot deprecate a pipeline with active schedules.

Trace ID : cded492c-84a5-47aa-afc4-0a678e611e5b
Client request ID : 4e904a8b-90f5-4572-815d-c23a0249c43b

Could you look into this? and instruct me how to stop that scheduled pipeline.
Thanks,

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,563 questions
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 46,566 Reputation points
    2021-04-09T23:13:45.673+00:00

    Hello,

    Thanks for reaching out to us.

    If you have a Pipeline that is published, but not scheduled, you can disable it with:

    pipeline = PublishedPipeline.get(ws, id=pipeline_id)
    pipeline.disable()
    

    If the pipeline is scheduled, you must cancel the schedule first. Retrieve the schedule's identifier from the portal or by running:

    ss = Schedule.list(ws)
    for s in ss:
        print(s)
    

    Once you have the schedule_id you wish to disable, run:

    def stop_by_schedule_id(ws, schedule_id):
        s = next(s for s in Schedule.list(ws) if s.id == schedule_id)
        s.disable()
        return s
    
    stop_by_schedule_id(ws, schedule_id)
    

    If you then run Schedule.list(ws) again, you should get an empty list.

    Regards,
    Yutong

    1 person found this answer helpful.
    0 comments No comments