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
Copy file name to clipboardExpand all lines: articles/machine-learning/prompt-flow/how-to-deploy-to-code.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,6 +255,11 @@ az ml online-deployment create --file blue-deployment.yml --all-traffic
255
255
```
256
256
257
257
This deployment might take up to 20 minutes, depending on whether the underlying environment or image is being built for the first time. Subsequent deployments that use the same environment will finish processing more quickly.
258
+
You need to give the following permissions to the system-assigned identity after the endpoint is created:
259
+
260
+
- AzureML Data Scientist role or a customized role with "Microsoft.MachineLearningServices/workspaces/connections/listsecrets/action" permission to workspace
261
+
- Storage Blob Data Contributor permission, and Storage Table Data Contributor to the default storage of the workspace
262
+
258
263
259
264
> [!TIP]
260
265
>
@@ -280,10 +285,30 @@ az ml online-deployment get-logs --name blue --endpoint basic-chat-endpoint
280
285
281
286
### Invoke the endpoint to score data by using your model
282
287
288
+
You can create a sample-request.json file like this:
289
+
290
+
```json
291
+
{
292
+
"question": "What is Azure Machine Learning?",
293
+
"chat_history": []
294
+
}
295
+
```
296
+
283
297
```Azure CLI
284
-
az ml online-endpoint invoke --name basic-chat-endpoint --request-file endpoints/online/model-1/sample-request.json
298
+
az ml online-endpoint invoke --name basic-chat-endpoint --request-file sample-request.json
285
299
```
286
300
301
+
You can also call it with an HTTP client, for example with curl:
302
+
303
+
```bash
304
+
ENDPOINT_KEY=<your-endpoint-key>
305
+
ENDPOINT_URI=<your-endpoint-uri>
306
+
307
+
curl --request POST "$ENDPOINT_URI" --header "Authorization: Bearer $ENDPOINT_KEY" --header 'Content-Type: application/json' --data '{"question": "What is Azure Machine Learning?", "chat_history": []}'
308
+
```
309
+
310
+
Note that you can get your endpoint key and your endpoint URI from the AzureML workspace in **Endpoints** > **Consume** > **Basic consumption info**.
311
+
287
312
## Next steps
288
313
289
314
- Learn more about [managed online endpoint schema](../reference-yaml-endpoint-online.md) and [managed online deployment schema](../reference-yaml-deployment-managed-online.md).
0 commit comments