监视 Azure SQL 托管实例管理操作Monitoring Azure SQL Managed Instance management operations

适用于: Azure SQL 托管实例

Azure SQL 托管实例提供对管理操作的监视,你可以使用这些操作来部署新的托管实例、更新实例属性,或删除不再需要的实例。Azure SQL Managed Instance provides monitoring of management operations that you use to deploy new managed instances, update instance properties, or delete instances when no longer needed.

概述Overview

所有管理操作可分类为:All management operations can be categorized as follows:

  • 部署实例(创建新实例)。Instance deployment (new instance creation).
  • 实例更新(更改实例属性,例如 vCore 数或预留存储)。Instance update (changing instance properties, such as vCores or reserved storage).
  • 删除实例。Instance deletion.

大多数管理操作都是长时间运行的操作Most management operations are long running operations. 因此,需要监视其状态或跟踪操作步骤的进度。Therefore there is a need to monitor the status or follow the progress of operation steps.

可以通过多种方式来监视托管实例管理操作:There are several ways to monitor managed instance management operations:

下表比较了管理操作监视选项:The following table compares management operation monitoring options:

选项Option 保留Retention 支持取消Supports cancel 创建Create 更新Update 删除Delete 取消Cancel 步骤Steps
资源组部署Resource group deployments 无限1Infinite1 2No2 可见Visible 可见Visible 不可见Not visible 可见Visible 不可见Not visible
活动日志Activity log 90 天90 days No 可见Visible 可见Visible 可见Visible 可见Visible 不可见Not visible
托管实例操作 APIManaged instance operations API 24 小时24 hours Yes 可见Visible 可见Visible 可见Visible 可见Visible 可见Visible

1 一个资源组的部署历史记录限含 800 个部署。1 The deployment history for a resource group is limited to 800 deployments.

2 资源组部署支持取消操作。2 Resource group deployments support cancel operation. 但出于取消逻辑,只有计划在执行取消操作后部署的操作才会被取消。However, due to cancel logic, only an operation scheduled for deployment after the cancel action is performed will be canceled. 取消资源组部署时,不会取消正在进行的部署。Ongoing deployment is not canceled when the resource group deployment is canceled. 由于托管实例部署包含一个长期步骤(从 Azure 资源管理器的角度来看),因此取消资源组部署不会取消托管实例部署,并且该操作将完成。Since managed instance deployment consists of one long running step (from the Azure Resource Manger perspective), canceling resource group deployment will not cancel managed instance deployment and the operation will complete.

托管实例操作 APIManaged instance operations API

管理操作 API 是为监视操作而专门设计的。Management operations APIs are specially designed to monitor operations. 监视托管实例操作可以提供对操作参数和操作步骤的见解,以及取消特定操作Monitoring managed instance operations can provide insights on operation parameters and operation steps, as well as cancel specific operations. 除操作详细信息和 cancel 命令之外,此 API 还可在具有多资源部署的自动化脚本中使用;根据进度步骤,你可以启动一些相关的资源部署。Besides operation details and cancel command, this API can be used in automation scripts with multi-resource deployments - based on the progress step, you can kick off some dependent resource deployment.

这些 API 如下:These are the APIs:

命令Command 描述Description
托管实例操作 - 获取Managed Instance Operations - Get 获取托管实例上的管理操作。Gets a management operation on a managed instance.
托管实例操作 - 取消Managed Instance Operations - Cancel 取消托管实例上的异步操作。Cancels the asynchronous operation on the managed instance.
托管实例操作 - 按托管实例列出Managed Instance Operations - List By Managed Instance 获取在托管实例上执行的操作的列表。Gets a list of operations performed on the managed instance.

备注

使用 API 版本 2020-02-02 查看操作列表中的托管实例创建操作。Use API version 2020-02-02 to see the managed instance create operation in the list of operations. 这是 Azure 门户以及最新的 PowerShell 和 Azure CLI 包中使用的默认版本。This is the default version used in the Azure portal and the latest PowerShell and Azure CLI packages.

监视操作Monitor operations

在 Azure 门户中,使用托管实例“概述”页监视托管实例操作。In the Azure portal, use the managed instance Overview page to monitor managed instance operations.

例如,“创建操作”在“概述”页上的创建过程开始时可见 :For example, the Create operation is visible at the start of the creation process on the Overview page:

托管实例创建过程

选择“正在执行的操作”以打开“正在执行的操作”页,然后查看“创建”或“更新”操作 。Select Ongoing operation to open the Ongoing operation page and view Create or Update operations. 你也可以在此页中取消操作。You can also Cancel operations from this page as well.

托管实例操作详细信息

备注

可以取消使用 REST API 版本 2020-02-02 通过 Azure 门户、PowerShell、Azure CLI 或其他工具提交的创建操作。Create operations submitted through Azure portal, PowerShell, Azure CLI or other tooling using REST API version 2020-02-02 can be canceled. 用于提交创建操作且低于 2020-02-02 版本的 REST API 将启动实例部署,但该部署不会在操作 API 中列出,且无法取消。REST API versions older than 2020-02-02 used to submit a create operation will start the instance deployment, but the deployment won't be listed in the Operations API and can't be cancelled.

后续步骤Next steps