gpt4 book ai didi

azure - 如何从 Application Insights 存储桶中清除记录?

转载 作者:行者123 更新时间:2023-12-02 08:17:38 25 4
gpt4 key购买 nike

我曾经遵循 https://learn.microsoft.com/en-us/rest/api/application-insights/components/purge 的指示,但现在它产生以下错误:

Purge operation on a workspace-based Application Insights resource is not supported. Instead, please run purge operation directly on the workspace, scoped to specific resource id. See more at https://aka.ms/purgeai"

好的,所以https://aka.ms/purgeai是新指令,但它没有解释如何“将操作范围限制到特定资源 id”,因为记录仍然位于 AI 存储桶中,而不是工作区中。

那么,我该如何在新世界中清除人工智能呢?

编辑 1

我应该说得更清楚。我不想清除所有记录。例如,考虑以下清除请求正文,这在过去就足够了:

{
"table": "customEvents",
"filters": [
{
"column": "customMeasurements",
"key": "seq",
"operator": "==",
"value": "''"
}
]
}

它可用于清除所有 customMeasurements.seq 为空的记录。现在如何将其与 _ResourceId 字段组合在一起?

当给出以下请求正文时:

{
"table": "customEvents",
"filters": [
{
"column": "customMeasurements",
"key": "seq",
"operator": "==",
"value": "''"
},
{
"column": "_ResourceId",
"operator": "==",
"value": "/subscriptions/.../resourcegroups/.../providers/microsoft.insights/components/..."
}
]
}

请求失败:

{
"error": {
"message": "The request had some invalid properties",
"code": "BadArgumentError",
"correlationId": "...",
"innererror": {
"code": "QueryValidationError",
"message": "'customEvents' is not a valid table"
}
}
}

编辑2

还有一个问题。事实上,考虑以下查询:

AppEvents 
| where Measurements.seq == '' and _ResourceId == '/subscriptions/d...8/resourcegroups/app508-re-mark-test/providers/microsoft.insights/components/app508-re-mark-test-ai'
| summarize count()

此查询有效并返回一些计数。

现在我想使用相同的条件来清除同一工作区中的记录:

{
"table": "AppEvents",
"filters": [
{
"column": "Measurements",
"key": "seq",
"operator": "==",
"value": "''"
},
{
"column": "_ResourceId",
"operator": "==",
"value": "/subscriptions/d...8/resourcegroups/app508-re-mark-test/providers/microsoft.insights/components/app508-re-mark-test-ai"
}
]
}

但我收到以下错误:

{
"error": {
"message": "The request had some invalid properties",
"code": "BadArgumentError",
"correlationId": "c08bb441-a316-4989-a527-202a101e515d",
"innererror": {
"code": "QueryValidationError",
"message": "Unsupported column '_ResourceId'"
}
}
}

请注意,省略 _ResourceId 是可行的,但我确实希望能够使用它。

我错过了什么?

最佳答案

感谢您的提问和反馈。
除了任何其他所需的过滤器之外,您需要做的是按特定资源 ID 进行过滤。

例如:

`{
"column": "_ResourceId",
"operator": "==",
"value": “/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource”
}`

请注意,经典应用程序见解和基于工作区的应用程序见解之间的表名称已更改。 例如,在您的情况下,表名称应为AppEvents,而不是customEvents。您可以查看this link对于其他表名称的更改。

我们还将修改文章以反射(reflect)此信息。

关于azure - 如何从 Application Insights 存储桶中清除记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72077011/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com