OperationalInsights API 版本停用OperationalInsights API version retirement

Microsoft 至少会在停用 API 前提前 12 个月发出通知,以便顺利转换为更高版本/受支持版本。Microsoft provides notification at least 12 months in advance of retiring an API in order to smooth the transition to a newer/supported version. 我们发布了 OperationalInsights 资源提供程序 API 新版本 (2020-08-01),并将于 2024 年 2 月 29 日停用任何早期的 API 版本。We have released a new version (2020-08-01) for OperationalInsights resource provider APIs and will retire any earlier API versions on February 29, 2024.

我们建议你立即开始使用 2020-08-01 版本,获享新功能的好处,例如专用集群客户管理的密钥We encourage you to start using version 2020-08-01 now to gain the benefits of new functionality, such as dedicated cluster, customer-managed keys. 此外,新特性、功能和优化仅添加到最新的 API 中。Also, new features and functionality and optimizations are only added to the current API.

2024 年 2 月 29 日后,Azure Monitor 将不再支持 2020-08-01 之前的早期 API 版本。After February 29, 2024 Azure Monitor will no longer support earlier APIs versions than 2020-08-01. 如果不想升级,则 Azure Monitor 服务在 2024 年 2 月 29 日之前,将继续处理从早期版本发送的请求。If you prefer not to upgrade, requests sent from earlier versions will continue to be served by the Azure Monitor service until February 29, 2024.

迁移步骤Migration steps

根据所使用的配置方法,你应该在 REST 请求和资源管理器模板中更新新版本 。Depending on the configuration method you use, you should update the new version in REST requests and Resource Manager templates. 请按照以下示例更新 API 版本:Follow the examples below to update the API version:

  1. REST API 请求在请求的 URL 中使用该 API 版本。REST API requests use the API version in the URL of the request. 将该版本替换为最新版本 (2020-08-01),如下面的示例中所示。Replace that version with the latest version (2020-08-01) as shown in the following example.

    https://management.chinacloudapi.cn/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}?api-version=2020-08-01
    
  2. Azure 资源管理器模板使用资源的 apiVersion 属性中的 API 版本。Azure Resource Manager templates use the API version in the apiVersion property of the resource. 将该版本替换为最新版本 (2020-08-01),如下面的示例中所示。Replace that version with the latest version (2020-08-01) as shown in the following example.

    {
        "$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "workspaceName": {
                "type": "string",
                "metadata": {
                "description": "Name of the workspace."
                }
            },
            "resources": [
            {
                "type": "Microsoft.OperationalInsights/workspaces",
                "name": "[parameters('workspaceName')]",
                "apiVersion": "2020-08-01",
                "location": "chinanorth",
                "properties": {
                    "sku": {
                        "name": "pergb2018"
                    },
                    "retentionInDays": 30,
                    "features": {
                        "searchVersion": 1,
                        "legacy": 0,
                        "enableLogAccessUsingOnlyResourcePermissions": true
                    }
                }
            }
        ]
    }
    }
    

后续步骤Next steps