You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -23,7 +23,7 @@ Batch endpoints support Azure Active Directory authentication, or `aad_token`. T
23
23
24
24
## How authentication works
25
25
26
-
To invoke a batch endpoint, the user must present a valid Azure Active Directory token representing a security principal. This principal can be a user principal or a service principal. In any case, once an endpoint is invoked, a batch deployment job is created under the identity associated with the token. The identity needs the following permissions in order to successfully create a job:
26
+
To invoke a batch endpoint, the user must present a valid Azure Active Directory token representing a security principal. This principal can be a __user principal__ or a __service principal__. In any case, once an endpoint is invoked, a batch deployment job is created under the identity associated with the token. The identity needs the following permissions in order to successfully create a job:
27
27
28
28
> [!div class="checklist"]
29
29
> * Read batch endpoints/deployments.
@@ -43,97 +43,139 @@ The following examples show different ways to start batch deployment jobs using
43
43
44
44
### Running jobs using user's credentials
45
45
46
-
# [Azure ML CLI](#tab/cli)
46
+
In this case, we want to execute a batch endpoint using the identity of the user currenly logged in. Follow these steps:
47
47
48
-
Use the Azure CLI to log in using either interactive or device code authentication:
48
+
> [!IMPORTANT]
49
+
> When working on a private link-enabled workspaces, batch endpoints can't be invoked from the UI in Azure ML studio. Please use the Azure ML CLI v2 instead for job creation.
49
50
50
-
```azurecli
51
-
az login
52
-
```
51
+
> [!NOTE]
52
+
> When working on Azure ML studio, batch endpoints/deployments are always executed using the identity of the current user logged in.
53
53
54
-
Once authenticated, use the following command to run a batch deployment job:
54
+
# [Azure ML CLI](#tab/cli)
55
55
56
-
```azurecli
57
-
az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/heart-disease-uci/data
58
-
```
56
+
1. Use the Azure CLI to log in using either interactive or device code authentication:
59
57
60
-
# [Azure ML SDK for Python](#tab/sdk)
58
+
```azurecli
59
+
az login
60
+
```
61
61
62
-
Use the Azure ML SDK for Python to log in using either interactive or device authentication:
62
+
1. Once authenticated, use the following command to run a batch deployment job:
63
63
64
-
```python
65
-
from azure.ai.ml import MLClient
66
-
from azure.identity import InteractiveAzureCredentials
64
+
```azurecli
65
+
az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/heart-disease-uci/data
In this case, we want to execute a batch endpoint using a service princpal already created in Azure Active Directory. To complete the authentication, you will have to create a secret to perform the authentication. Follow these steps:
97
+
92
98
# [Azure ML CLI](#tab/cli)
93
99
94
-
For more details see [Sign in with Azure CLI](/cli/azure/authenticate-azure-cli).
100
+
1. Create a secret to use for authentication as explained at [Option 2: Create a new application secret](../../active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).
101
+
1. For more details see [Sign in with Azure CLI](/cli/azure/authenticate-azure-cli).
95
102
96
-
```bash
97
-
az login --service-principal -u <app-id> -p <password-or-cert> --tenant <tenant>
98
-
```
103
+
```bash
104
+
az login --service-principal -u <app-id> -p <password-or-cert> --tenant <tenant>
105
+
```
99
106
100
-
Once authenticated, use the following command to run a batch deployment job:
107
+
1. Once authenticated, use the following command to run a batch deployment job:
101
108
102
-
```azurecli
103
-
az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/heart-disease-uci/data
104
-
```
109
+
```azurecli
110
+
az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/heart-disease-uci/data
111
+
```
105
112
106
113
# [Azure ML SDK for Python](#tab/sdk)
107
114
108
-
To authenticate using a service principal, indicate the tenant ID, client ID and client secret of the service principal using environment variables as demonstrated here:
You can't run jobs using a service principal from studio.
115
+
1. Create a secret to use for authentication as explained at [Option 2: Create a new application secret](../../active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).
116
+
1. To authenticate using a service principal, indicate the tenant ID, client ID and client secret of the service principal using environment variables as demonstrated:
You can use the REST API of Azure Machine Learning to start a batch endpoints job using the user's credential. Follow these steps:
145
+
146
+
1. Use the login service from Azure to get an authorization token. Authorization tokens are issued to a particular scope. The resource type for Azure Machine learning is `https://ml.azure.com`. The request would look as follows:
> Notice that the resource scope for invoking a batch endpoints (`https://ml.azure.com1) is different from the resource scope used to manage them. All management APIs in Azure use the resource scope `https://management.azure.com`, including Azure Machine Learning.
155
+
156
+
3. Once authenticated, use the query to run a batch deployment job:
0 commit comments