Problem when launching a child run on AzureML

MARCO PINHEIRO 11 Reputation points
2020-10-16T17:55:17.083+00:00

Got a error when trying to launch child runs from a pipeline step.

In pipeline step I have this:

import argparse
from azureml.core import Run, ScriptRunConfig
from azureml.core.model import Model
from azureml.core.environment import Environment

run = Run.get_context()
compute_target = run.experiment.workspace.compute_targets[run.get_details()['target']]

parser = argparse.ArgumentParser("args")
parser.add_argument("--train_path", type=str, help="train_path")
parser.add_argument("--test_path", type=str, help="test_path")
args = parser.parse_args()

child_config_xgboost = ScriptRunConfig(
    source_directory=".",
    script='xgboost_model.py',
    arguments=['--train_path', args.train_path, "--test_path", args.test_path],
    compute_target=compute_target,
    environment=run.get_environment()
)

child_xgboost=run.submit_child(child_config_xgboost)
child_xgboost.wait_for_completion()

I receive this error:

Traceback (most recent call last):
  File "train.py", line 7, in <module>
    compute_target = run.experiment.workspace.compute_targets[run.get_details()['target']]
  File "/azureml-envs/azureml_912ebce86aa851a4f789bc2c01e320a3/lib/python3.6/site-packages/azureml/core/workspace.py", line 1009, in compute_targets
    compute_target.name: compute_target for compute_target in ComputeTarget.list(self)}
  File "/azureml-envs/azureml_912ebce86aa851a4f789bc2c01e320a3/lib/python3.6/site-packages/azureml/core/compute/compute.py", line 535, in list
    env_obj = child.deserialize(workspace, env)
  File "/azureml-envs/azureml_912ebce86aa851a4f789bc2c01e320a3/lib/python3.6/site-packages/azureml/core/compute/computeinstance.py", line 638, in deserialize
    target._initialize(workspace, object_dict)
  File "/azureml-envs/azureml_912ebce86aa851a4f789bc2c01e320a3/lib/python3.6/site-packages/azureml/core/compute/computeinstance.py", line 130, in _initialize
    status.created_by_user_org)
  File "/azureml-envs/azureml_912ebce86aa851a4f789bc2c01e320a3/lib/python3.6/site-packages/azureml/core/compute/computeinstance.py", line 947, in _get_user_display_name
    headers = {"Authorization": "Bearer " + workspace._auth._get_graph_token()}
  File "/azureml-envs/azureml_912ebce86aa851a4f789bc2c01e320a3/lib/python3.6/site-packages/azureml/core/authentication.py", line 1455, in _get_graph_token
    raise AuthenticationException("AzureMLTokenAuthentication._get_graph_token "
UserScriptException: UserScriptException:
 Message: AzureMLTokenAuthentication._get_graph_token not yet supported.
 InnerException AuthenticationException:
 Message: AzureMLTokenAuthentication._get_graph_token not yet supported.
 InnerException None
 ErrorResponse 
{
    "error": {
        "code": "UserError",
        "inner_error": {
            "code": "Authentication"
        },
        "message": "AzureMLTokenAuthentication._get_graph_token not yet supported."
    }
}
 ErrorResponse 
{
    "error": {
        "code": "UserError",
        "message": "AzureMLTokenAuthentication._get_graph_token not yet supported."
    }
}

How can I launch a child run using a ScriptRunConfig with the same environment and compute target as the parent run?

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

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,521 Reputation points
    2020-10-19T13:25:39.42+00:00

    @MARCO PINHEIRO Thanks, Find more details here for secret and for submit child..

    from azureml.core import Experiment, Run  
      
    run = Run.get_context()  
    secret_value = run.get_secret(name="mysecret")  
    

    Here is the example using ScriptRunConfig(), you can access the key vault when you use ScriptRunConfig().

    Also, Here are the details to create an environment and configure and run training runs.

    1 person found this answer helpful.