如何使用 Rest Api 获取 Azure 机器学习服务管道 运行 的状态?

How to get status of Azure machine learning service pipeline run using Rest Api?

我已经创建了一个 Azure 机器学习服务管道,我正在使用它的 rest 端点从外部调用它。 但我还需要定期监视它的 运行 ,无论它是完成还是失败。 机器学习管道的剩余端点内是否有方法,我可以点击它来检查其 运行 状态? 我已经尝试了 link 这里提到的步骤 https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb

要获取 运行 的状态,您可以使用此处描述的 REST API https://github.com/Azure/azure-rest-api-specs/tree/master/specification/machinelearningservices/data-plane

具体你需要https://github.com/Azure/azure-rest-api-specs/blob/master/specification/machinelearningservices/data-plane/Microsoft.MachineLearningServices/preview/2019-08-01/runHistory.json

使用此调用获取 运行 信息,包括状态:

/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details

谢谢 Prashant! 以下端点有效。

https://{location}.experiments.azureml.net/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}

如果它有助于搜索此内容的人,这里有更多信息。

  • 将上述端点与 GET 方法和授权 Bearer Access Token
  • 结合使用

要获取访问令牌,请执行以下操作。

curl -X POST https://login.microsoftonline.com/{your-tenant-id}/oauth2/token
-d "grant_type=client_credentials&resource=https%3A%2F%2Fmanagement.azure.com%2F&client_id={your-client-id}&client_secret={your-client-secret}" \

更多信息,关注How to Manage REST - Create, run, and delete Azure ML resources using REST