Skip to content

Commit ee08929

Browse files
authored
Merge pull request #115376 from ouphi/improve-promptflow-online-endpoint-doc
Documented online-endpoint required permissions + example of request to call the endpoint
2 parents 9c884ef + 993a6e7 commit ee08929

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

articles/machine-learning/prompt-flow/how-to-deploy-to-code.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ az ml online-deployment create --file blue-deployment.yml --all-traffic
255255
```
256256

257257
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+
258263

259264
> [!TIP]
260265
>
@@ -280,10 +285,30 @@ az ml online-deployment get-logs --name blue --endpoint basic-chat-endpoint
280285

281286
### Invoke the endpoint to score data by using your model
282287

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+
283297
```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
285299
```
286300

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+
287312
## Next steps
288313

289314
- 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

Comments
 (0)