Skip to content

Commit 3495c25

Browse files
Merge pull request #239721 from santiagxf/santiagxf/azureml-batch-authenticate
Update how-to-authenticate-batch-endpoint.md
2 parents a4ad093 + 70bddfe commit 3495c25

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

articles/machine-learning/how-to-authenticate-batch-endpoint.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,40 @@ In this case, we want to execute a batch endpoint using the identity of the user
9191
9292
# [REST](#tab/rest)
9393
94-
When working with REST APIs, we recommend to using either a [service principal](#running-jobs-using-a-service-principal) or a [managed identity](#running-jobs-using-a-managed-identity) to interact with the API.
94+
When working with REST, we recommend invoking batch endpoints using a service principal. However, if you want to test a particular deployment using REST with your own credentials, you can do it by generating an Azure AD token for your account. Follow these steps:
95+
96+
1. The simplest way to get a valid token for your user account is to use the Azure CLI. In a console, run the following command:
97+
98+
```azurecli
99+
az account get-access-token --resource https://ml.azure.com --query "accessToken" --output tsv
100+
```
101+
102+
1. Take note of the generated output.
103+
104+
1. Once authenticated, make a request to the invocation URI replacing `<TOKEN>` by the one you obtained before.
105+
106+
__Request__:
107+
108+
```http
109+
POST jobs HTTP/1.1
110+
Host: <ENDPOINT_URI>
111+
Authorization: Bearer <TOKEN>
112+
Content-Type: application/json
113+
```
114+
__Body:__
115+
116+
```json
117+
{
118+
"properties": {
119+
"InputData": {
120+
"mnistinput": {
121+
"JobInputType" : "UriFolder",
122+
"Uri": "https://azuremlexampledata.blob.core.windows.net/data/heart-disease-uci"
123+
}
124+
}
125+
}
126+
}
127+
```
95128
96129
---
97130

0 commit comments

Comments
 (0)