Azure ML Command Job Parameter Passing

DP-100 By islever Editorial Last updated

Short answer

A Yes

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You manage an Azure Machine Learning workspace. The Python script named script.py reads an argument named training_data. The training_data argument specifies the path to the training data in a file named dataset1.csv. You plan to run the script.py Python script as a command job that trains a machine learning model. You need to provide the command to pass the path for the dataset as a parameter value when you submit the script as a training job. Solution: python script.py --training_data dataset1.csv Does the solution meet the goal?
  1. Yes Correct Answer
  2. No

Key Takeaways

The question tests whether a static file path string is acceptable as a parameter value in an Azure ML command job definition versus using input bindings.

This question tests the correct syntax for passing arguments to Python scripts in Azure Machine Learning command jobs. The community consensus is divided, but the official answer confirms that direct string literals are valid for local testing or simple scenarios.

Common mistake: Candidates often choose 'No' because they confuse command jobs with data assets/inputs, expecting the use of `${{inputs.*}}` syntax which is required for referencing registered datasets, not static file paths.

Expert Analysis

Why the Answer Is Correct

The solution meets the goal because Azure ML command jobs allow you to pass literal strings as arguments to your script's entry point. When you define the command in the Command object, you can specify arguments like --training_data dataset1.csv. This tells the runtime to execute python script.py --training_data dataset1.csv. It is a valid way to provide configuration values that do not change per run.

Why the Other Options Are Wrong

Choosing 'No' typically stems from overcomplicating the scenario. While best practices for production pipelines involve using Data objects and ${{inputs.training_data}} to reference registered datasets, the question does not state that dataset1.csv is a registered asset. It simply asks if the command can be provided this way. Since the syntax is technically correct for passing a static argument, 'Yes' is the accurate technical response.

Community Comment Notes

Comments show significant confusion between static arguments and dynamic input bindings. Comment [1] argues for 'No', suggesting the use of ${{inputs.training_data}}, which is correct for registered datasets but unnecessary for a simple file path argument in a basic command job context. Comments [2] and [4] correctly identify that the solution is valid, highlighting that direct assignment is supported.

Official Reference

https://learn.microsoft.com/en-us/azure/machine-learning/how-to-train-ml-models

This link opens the official vendor documentation in a new tab.

Exam Strategy

Distinguish between passing static configuration values (strings) and dynamic data references (inputs). If the question involves a specific file path or constant value, a direct string argument is usually sufficient unless the problem explicitly mentions 'registered datasets' or 'data assets'.

Community Votes

A
60%
B
40%

60% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 4 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 4

  1. avinyc 👍 1 Answered B
    No. Correct method in Azure ML is: python script.py --training_data ${{inputs.training_data}}
  2. jefimija 👍 2 Answered A
    this should be yes
  3. colin1919 👍 1 Answered B
    No, the path is not specified
  4. D0ktor 👍 1 Answered A
    Absolutely yes

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

← Back to DP-100 Study Guide