How to cancel current pipeline job "from within" in Azure ML sdk v2
Celso Araujo
0
Reputation points
I am porting a sdk v1 machine learning pipeline to SDK v2. It runs on a daily basis on a scheduler. We have a step which, under certain conditions, cancels the whole pipeline job (ie, the other steps won't run). Its code is like this:
from azureml.core import Run
from azureml.pipeline.core import PipelineRun
run = Run.get_context()
ws = run.experiment.workspace
pipeline_run = PipelineRun(run.experiment, run.parent.id)
if condition:
pipeline_run.cancel()
I can't find a way to do something similar using Python SDK v2. And I don't want to mix v1 and v2 code, since it is a bad practice. How could I do it? Any ideas?
Sign in to answer