question

EmilioGagliardi-5163 avatar image
0 Votes"
EmilioGagliardi-5163 asked MURALIDHARANSRINIVASAN-1683 commented

Disable Scheduled pipeline endpoint

Hi there,

I am following the microsoft learn tutorials, and one of them had us publish a pipeline with a schedule.

recurrence = ScheduleRecurrence(frequency="Week", interval=1, week_days=["Monday"], time_of_day="00:00")
weekly_schedule = Schedule.create(ws, name="weekly-diabetes-training",
description="Based on time",
pipeline_id=published_pipeline.id,
experiment_name='mslearn-diabetes-pipeline',
recurrence=recurrence)

Now I'd like to delete that pipeline, but when I try to delete it in the Pipelines > Pipeline Endpoints section, I get an error saying that a pipeline with a schedule cannot be disabled.

There is no code provided to remove or delete the schedule. Can anyone provide the python code necessary to remove the schedule from the pipeline so I can delete it?

Thank you kindly,

azure-machine-learning-inference
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The error is:

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

1 Vote 1 ·

1 Answer

MatteoBeshara-7121 avatar image
1 Vote"
MatteoBeshara-7121 answered MURALIDHARANSRINIVASAN-1683 commented

The solution is:

 from azureml.pipeline.core import Schedule
 import azureml.core
 from azureml.core import Workspace
    
 # Load the workspace from the saved config file
 ws = Workspace.from_config()
 sch = Schedule.list(ws)[0] # I want to disable the first pipeline
    
 Schedule.disable(sch)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This code helped. Disabling the scheduled pipeline through code. Then deleting the pipeline.

0 Votes 0 ·