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/ai-foundry/how-to/develop/trace-production-sdk.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,8 @@ In this article, you learn to enable tracing, collect aggregated metrics, and co
27
27
## Prerequisites
28
28
29
29
- The Azure CLI and the Azure Machine Learning extension to the Azure CLI.
30
-
- An Azure AI Foundry project. If you don't already have a project, you can [create one here](../../how-to/create-projects.md).
31
-
- An Application Insights resource. If you don't already have an Application Insights resource, you can [create one here](/azure/azure-monitor/app/create-workspace-resource).
30
+
- An Azure AI Foundry project. If you don't already have a project, you can [create one](../../how-to/create-projects.md).
31
+
- An Application Insights resource. If you don't already have an Application Insights resource, you can [create one](/azure/azure-monitor/app/create-workspace-resource).
32
32
- Azure role-based access controls are used to grant access to operations in Azure Machine Learning. To perform the steps in this article, you must have Owner or Contributor permissions on the selected resource group. For more information, see [Role-based access control in the Azure AI Foundry portal](../../concepts/rbac-ai-foundry.md).
33
33
34
34
## Deploy a flow for real-time inference
@@ -43,13 +43,13 @@ Use the latest prompt flow base image to deploy the flow so that it supports the
43
43
44
44
If you're using the Azure AI Foundry portal to deploy, select **Deployment** > **Application Insights diagnostics** > **Advanced settings** in the deployment wizard. In this way, the tracing data and system metrics are collected to the project linked to Application Insights.
45
45
46
-
If you're using the SDK or the CLI, add the `app_insights_enabled: true` property in the deployment yaml file that collects data to the project linked to Application Insights.
46
+
If you're using the SDK or the CLI, add the `app_insights_enabled: true` property in the deployment .yaml file that collects data to the project linked to Application Insights.
47
47
48
48
```yaml
49
49
app_insights_enabled: true
50
50
```
51
51
52
-
You can also specify other application insights by the environment variable `APPLICATIONINSIGHTS_CONNECTION_STRING` in the deployment yaml file. You can find the connection string for Application Insights on the **Overview** page in the Azure portal.
52
+
You can also specify other application insights by the environment variable `APPLICATIONINSIGHTS_CONNECTION_STRING` in the deployment .yaml file. You can find the connection string for Application Insights on the **Overview** page in the Azure portal.
53
53
54
54
```yaml
55
55
environment_variables:
@@ -75,14 +75,14 @@ The **Dependency** type event records calls from your deployments. The name of t
75
75
76
76
| Metrics name | Type | Dimensions | Description |
| `flow_latency` | histogram | `flow`, `response_code`, `streaming`, `response_type` | The request execution cost, `response_type`, means whether it's full or first byte or last byte.|
| `flow_streaming_response_duration` | histogram | `flow` | The streaming response sending cost, ranging from sending the first byte to sending the last byte. |
86
86
87
87
You can find the workspace default Application Insights metrics on your workspace overview page in the Azure portal.
88
88
@@ -93,7 +93,7 @@ You can find the workspace default Application Insights metrics on your workspac
93
93
94
94
Prompt flow serving provides a new `/feedback` API to help customers collect the feedback. The feedback payload can be any JSON format data. Prompt flow serving helps the customer save the feedback data to a trace span. Data is saved to the trace exporter target that the customer configured. Prompt flow serving also supports OpenTelemetry standard trace context propagation. It respects the trace context set in the request header and uses that context as the request parent span context. You can use the distributed tracing functionality to correlate the feedback trace to its chat request trace.
95
95
96
-
The following sample code shows how to score a flow deployed to a managed endpoint that was enabled for tracing and send the feedback to the same trace span of a scoring request. The flow has the inputs `question` and `chat_history`. The output is `answer`. After the endpoint is scored, feedback is collected and sent to application insights that are specified when you deploy the flow.
96
+
The following sample code shows how to score a flow deployed to a managed endpoint that was enabled for tracing and send the feedback to the same trace span of a scoring request. The flow has the inputs `question` and `chat_history`. The output is `answer`. After the endpoint is scored, feedback is collected and sent to Application Insights as specified when you deploy the flow.
Copy file name to clipboardExpand all lines: articles/ai-foundry/how-to/flow-deploy.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,14 +74,10 @@ To deploy a prompt flow as an online endpoint in the Azure AI Foundry portal:
74
74
75
75
:::image type="content" source="../media/prompt-flow/how-to-deploy-for-real-time-inference/deployments-score-url-samples.png" alt-text="Screenshot that shows the deployment endpoint and code samples." lightbox = "../media/prompt-flow/how-to-deploy-for-real-time-inference/deployments-score-url-samples.png":::
76
76
77
-
For more information, see the following sections.
78
-
79
77
For information about how to deploy a base model, see [Deploy models with Azure AI Foundry](deploy-models-managed.md).
80
78
81
79
## Settings and configurations
82
80
83
-
This section discusses settings and configurations.
84
-
85
81
### Requirements text file
86
82
87
83
Optionally, you can specify extra packages that you need in `requirements.txt`. You can find `requirements.txt` in the root folder of your flow folder. When you deploy a prompt flow to a managed online endpoint in the UI, by default, the deployment uses the environment that was created based on the base image specified in `flow.dag.yaml` and the dependencies specified in `requirements.txt` of the flow.
@@ -126,7 +122,9 @@ System-assigned identity is autocreated after your endpoint is created. The user
126
122
127
123
##### System assigned
128
124
129
-
Notice the option **Enforce access to connection secrets (preview)**. If your flow uses connections, the endpoint needs to access connections to perform inference. The option is enabled by default. The endpoint is granted the Azure Machine Learning Workspace Connection Secrets Reader role to access connections automatically if you have connection secrets reader permission. If you disable this option, you need to grant this role to the system-assigned identity manually or ask your admin for help. For more information, see [Grant permission to the endpoint identity](#grant-permissions-to-the-endpoint).
125
+
Notice the option **Enforce access to connection secrets (preview)**. If your flow uses connections, the endpoint needs to access connections to perform inference. The option is enabled by default.
126
+
127
+
The endpoint is granted the Azure Machine Learning Workspace Connection Secrets Reader role to access connections automatically if you have connection secrets reader permission. If you disable this option, you need to grant this role to the system-assigned identity manually or ask your admin for help. For more information, see [Grant permission to the endpoint identity](#grant-permissions-to-the-endpoint).
130
128
131
129
##### User assigned
132
130
@@ -136,9 +134,9 @@ If you created the associated endpoint with the **User Assigned Identity** optio
136
134
137
135
|Scope|Role|Why it's needed|
138
136
|---|---|---|
139
-
|Azure AI Foundry project|**Azure Machine Learning Workspace Connection Secrets Reader** role or a customized role with `Microsoft.MachineLearningServices/workspaces/connections/listsecrets/action`|Get project connections.|
|Azure AI Foundry project default storage|**Storage Blob Data Reader**|Load model from storage. |
137
+
|Azure AI Foundry project|**Azure Machine Learning Workspace Connection Secrets Reader** role or a customized role with `Microsoft.MachineLearningServices/workspaces/connections/listsecrets/action`|Gets project connections.|
|Azure AI Foundry project default storage|**Storage Blob Data Reader**|Loads a model from storage. |
142
140
|Azure AI Foundry project|**Azure Machine Learning Metrics Writer (preview)**| After you deploy the endpoint, if you want to monitor the endpoint-related metrics like CPU/GPU/Disk/Memory utilization, give this permission to the identity.<br/><br/>Optional|
143
141
144
142
For more information about how to grant permissions to the endpoint identity, see [Grant permissions to the endpoint](#grant-permissions-to-the-endpoint).
@@ -214,7 +212,7 @@ For endpoints deployed from standard flow, you can input values in the form edit
214
212
215
213
For endpoints deployed from a chat flow, you can test it in an immersive chat window.
216
214
217
-
The `chat_input` was set during development of the chat flow. You can input the `chat_input` message in the input box. If your flow has multiple inputs, you can specify the values for other inputs besides the `chat_input`in the **Inputs** pane on the right side.
215
+
The `chat_input`message was set during the development of the chat flow. You can put the `chat_input` message in the input box. If your flow has multiple inputs, you can specify the values for other inputs besides the `chat_input`message on the **Inputs** pane on the right side.
Copy file name to clipboardExpand all lines: articles/ai-foundry/how-to/monitor-quality-safety.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ In this section, you learn how to deploy your prompt flow with inferencing data
133
133
134
134
:::image type="content" source="../media/deploy-monitor/monitor/deployment-with-data-collection-enabled.png" alt-text="Screenshot that shows the Review page in the deployment wizard with all settings completed." lightbox = "../media/deploy-monitor/monitor/deployment-with-data-collection-enabled.png":::
135
135
136
-
By default, all inputs and outputs of your deployed prompt flow application are collected to your Blob Storage. As users invoke the deployment, the data is collected for your monitor to use.
136
+
By default, all inputs and outputs of your deployed prompt flow application are collected to your blob storage. As users invoke the deployment, the data is collected for your monitor to use.
137
137
138
138
1. Select the **Test** tab on the deployment page. Then test your deployment to ensure that it's working properly.
139
139
@@ -164,7 +164,7 @@ In this section, you learn how to configure monitoring for your deployed prompt
164
164
165
165
:::image type="content" source="../media/deploy-monitor/monitor/column-map-advanced-options.png" alt-text="Screenshot that shows advanced options when you map columns for monitoring metrics." lightbox = "../media/deploy-monitor/monitor/column-map-advanced-options.png":::
166
166
167
-
If data collection isn't enabled for your deployment, creation of a monitor enables collection of inferencing data to your Blob Storage. This task takes the deployment offline for a few minutes.
167
+
If data collection isn't enabled for your deployment, creation of a monitor enables collection of inferencing data to your blob storage. This task takes the deployment offline for a few minutes.
168
168
169
169
1. Select **Create** to create your monitor.
170
170
@@ -196,7 +196,7 @@ from azure.identity import DefaultAzureCredential
196
196
197
197
credential = DefaultAzureCredential()
198
198
199
-
# Update your azure resources details
199
+
# Update your Azure resources details
200
200
subscription_id ="INSERT YOUR SUBSCRIPTION ID"
201
201
resource_group ="INSERT YOUR RESOURCE GROUP NAME"
202
202
project_name ="INSERT YOUR PROJECT NAME"# This is the same as your Azure AI Foundry project name
@@ -301,7 +301,7 @@ After you create your monitor, it runs daily to compute the token usage and gene
301
301
-**Prompt token count**: The number of prompt tokens used by the deployment during the selected time window.
302
302
-**Completion token count**: The number of completion tokens used by the deployment during the selected time window.
303
303
304
-
1. View the metrics on the **Token usage** tab. (This tab is selected by default.) Here, you can view the token usage of your application over time. You can also view the distribution of prompt and completion tokens over time. You can change the **Trendline scope** value to monitor all tokens in the entire application or token usage for a particular deployment (for example, gpt-4) used within your application.
304
+
1. View the metrics on the **Token usage** tab. (This tab is selected by default.) Here, you can view the token usage of your application over time. You can also view the distribution of prompt and completion tokens over time. You can change the **Trendline scope** value to monitor all tokens in the entire application or token usage for a particular deployment (for example, GPT-4) used within your application.
305
305
306
306
:::image type="content" source="../media/deploy-monitor/monitor/monitor-token-usage.png" alt-text="Screenshot that shows the token usage on the deployment's monitoring page." lightbox = "../media/deploy-monitor/monitor/monitor-token-usage.png":::
307
307
@@ -362,7 +362,7 @@ from azure.identity import DefaultAzureCredential
362
362
363
363
credential = DefaultAzureCredential()
364
364
365
-
# Update your azure resources details
365
+
# Update your Azure resources details
366
366
subscription_id ="INSERT YOUR SUBSCRIPTION ID"
367
367
resource_group ="INSERT YOUR RESOURCE GROUP NAME"
368
368
project_name ="INSERT YOUR PROJECT NAME"# This is the same as your Azure AI Foundry project name
0 commit comments