How to get pipeline (View profiling) detail through Azure ML SDK in Python?

Puneet 0 Reputation points
2025-01-20T17:01:56.3933333+00:00

Screenshot 2025-01-20 223941

Hi team,

I'm struggling to figure out how we can get the pipeline profiling detail.

Can anyone please guide


from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

# Initialize the MLClient
ml_client = MLClient(
     DefaultAzureCredential(),
     subscription_id="<Sub_id>",
     resource_group_name="<Resource_group>",
    workspace_name="<Workspace_nmae>"
 )

# Get job details
job_details = ml_client.jobs.get(name="purple_forest_lfzpft1y51")
Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,086 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty (Quadrant Resource LLC) 95 Reputation points Microsoft Vendor
    2025-01-21T09:36:59.2933333+00:00

    Hi Puneet

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    Profiling option of pipelines outputs overall pipeline performance details with respect to duration of each step in Gantt chart.

    I could not find or come with exact SDK documentation right away, but we will have to get all child steps and extract their details like name, duration etc.

    Here is sample SDK snippet drafted on the basis of pipeline input and output documentation

    from azure.ai.ml import MLClient
    from azure.identity import DefaultAzureCredential
    from azure.ai.ml.entities import Job
    # Authenticate and create ML client
    credential = DefaultAzureCredential()
    ml_client = MLClient(credential, subscription_id, resource_group, workspace_name)
    # Get the details of the pipeline job
    pipeline_job = ml_client.jobs.get(pipeline_job.name)
    # Fetch the job's child runs (each step in the pipeline)
    child_jobs = ml_client.jobs.list(parents=pipeline_job.name)
    # Print the name and duration of each step
    for child_job in child_jobs:
        print(f"Step Name: {child_job.name}")
        print(f"Start Time: {child_job.start_time}")
        print(f"End Time: {child_job.end_time}")
        duration = child_job.end_time - child_job.start_time
        print(f"Duration: {duration}\n")
    
    

    Hope it helps.

    If this answers your query, do click **Accept Answer **and Yes for was this answer helpful.

    Thank you.


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.