Azure ML workspace authorization failing when running via pipeline - OAuth 2.0 device flow error

- 51 Reputation points Microsoft Employee
2022-05-21T03:30:26.547+00:00

I followed the instructions here: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-create-machine-learning-pipelines to publish and run a pipeline.

But the pipeline steps throws the following error:

"error": {
"message": "AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Timestamp: 2022-05-20 18:17:51Z"
}

From the error message, it looks like the pipeline step is stuck at the 'interactive authorization' step and timesout after 900.0 sec.

At the moment we are just testing this in lower environment, hence I have not used service principal for authorization.

Can someone please suggest how to fix this?

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

2 answers

Sort by: Most helpful
  1. Ramr-msft 17,611 Reputation points
    2022-05-24T07:37:20.3+00:00

    @tender-honey Thanks for the details. We are able to successfully authenticate. Interactive authentication uses your browser, and requires cookies (including 3rd party cookies). If you have disabled cookies. The error may also occur if you have enabled Azure AD Multi-Factor Authentication.

    Please follow the document to setup authentication.


  2. - 51 Reputation points Microsoft Employee
    2022-05-25T23:21:03.047+00:00

    @Ramr-msft - I ended up using a service principal to authenticate. Still not sure how to use interactive authorization in pipelines.

    But now I am stuck at another point, below is the code for my pipeline:

    *datastore_name = 'tmp'
    datastore = Datastore.get(workspace, datastore_name)
    step1_output_data = OutputFileDatasetConfig(name="step1_output_data", destination=(datastore, "{run-id}/"))
    curated_env_name = 'my-env'
    pytorch_env = Environment.from_conda_specification(name=curated_env_name, file_path='./conda_dependencies.yml')
    cluster_name = 'cpu64'

    src = ScriptRunConfig(
    source_directory='../../python-pipeline',
    script="1.py",
    compute_target=cluster_name,
    environment=pytorch_env,
    )

    step_1 = PythonScriptStep(
    name="step_1",
    script_name="1.py",
    source_directory='../../python-pipeline',
    compute_target=cluster_name,
    arguments=[step1_output_data],
    allow_reuse=True,
    runconfig=src.run_config,
    )

    step_2 = PythonScriptStep(
    name="step_2",
    script_name="2.py",
    source_directory='../../python-pipeline',
    compute_target=cluster_name,
    arguments=[step1_output_data.as_input(name='step1_output_data')],
    allow_reuse=True,
    )*

    When I run the above pipeline, the step_1 shows complete, BUT when I read through the logs, i see this:

    {"FileSystemName":"data","Uri":null,"Account":"storage_acc_name","RelativePath":"6666666-8888-4444-bbbb-fffffffffffff/step1_output_data","PathType":0,"AmlDataStoreName":"tmp"}

    I would expect this step1_output_data to be written out in the adls gen 2, but as the URI above is null, it is not writing anything.

    And as a result of this, step_2 fails with :

    "error": {
    "code": "UserError",
    "message": "Cannot mount Dataset(id='6666666-8888-4444-bbbb-fffffffffffff', name='None', version=None). Error Message: DataAccessError(NotFound)"
    }

    0 comments No comments