SQL Managed Instance (SQL MI) の計画メンテナンスの一覧を取得する方法を紹介します。
手順
1. Azure Resource Graph Explorer への接続
クイック スタート: Azure portal を使用して Resource Graph クエリを実行する の手順に従って、Resource Graph Explorer へ接続します。
2. 計画メンテナンス一覧の取得
Resource Graph Explorer の クエリウィンドウ に以下のクエリを張り付け、 My_Instance_Name を一覧を取得する SQL MI インスタンス名に置き換えて実行します。
resources
| project resource = tolower(id)
| join kind=inner (
maintenanceresources
| where type == “microsoft.maintenance/updates”
| extend p = parse_json(properties)
| mvexpand d = p.value
| where d has ‘notificationId’ and name contains “My_Instance_Name“
| project resource = tolower(name), status = d.status, trackingId = d.notificationId, starttime = d.startTimeUtc, endtime = d.endTimeUtc
) on resource
|project resource, status, trackingId, starttime, endtime
例: SQL MI インスタンス mysqlmi.abc1234.database.windows.net の計画メンテナンス一覧
1 2 3 4 5 6 7 8 9 10 11
| resources | project resource = tolower(id) | join kind=inner ( maintenanceresources | where type == "microsoft.maintenance/updates" | extend p = parse_json(properties) | mvexpand d = p.value | where d has 'notificationId' and name contains "mysqlmi" | project resource = tolower(name), status = d.status, trackingId = d.notificationId, starttime = d.startTimeUtc, endtime = d.endTimeUtc ) on resource |project resource, status, trackingId, starttime, endtime
|
以下のようにクエリを変更することで、クエリ実行者が一覧表示権限を持つ SQL MI の計画メンテナンス一覧を取得することもできます。
1 2 3 4 5 6 7 8 9 10 11 12
| resources | project resource = tolower(id) | join kind=inner ( maintenanceresources | where type == "microsoft.maintenance/updates" | extend p = parse_json(properties) | mvexpand d = p.value | where d has 'notificationId' | where d has 'managedinstances' | project resource = tolower(name), status = d.status, trackingId = d.notificationId, starttime = d.startTimeUtc, endtime = d.endTimeUtc ) on resource |project resource, status, trackingId, starttime, endtime
|
神谷 雅紀
Azure SQL Managed Instance support, Microsoft
※本情報の内容(添付文書、リンク先などを含む)は、作成日時点でのものであり、予告なく変更される場合があります。