SQL Insights を使用して警告を作成する (プレビュー)

適用対象:Azure SQL DatabaseAzure SQL Managed Instance

SQL Insights (プレビュー) には、一般的な SQL の問題について Azure Monitor で警告ルールを作成するために使用できる一連の警告ルール テンプレートが含まれています。 SQL Insights (プレビュー) の警告ルールは、Azure Monitor ログの InsightsMetrics テーブルに格納されているパフォーマンス データに基づくログ警告ルールです。

注意

Resource Manager テンプレートを使用して SQL insights (プレビュー) のアラートを作成するには、「SQL Insights 用の Resource Manager テンプレートのサンプル (プレビュー)」を参照してください。

注意

その他の SQL Insights (preview) の警告ルール テンプレートが必要な場合は、このページの下部にあるリンクを使用するか、Azure portal の SQL Insights (preview) フィードバック リンクを使用して、フィードバックをお送りください。

アラート ルールを有効にする

次の手順に従って、Azure portal から Azure Monitor の警告を有効にします。 作成される警告ルールのスコープは、選択した監視プロファイルで監視されているすべての SQL リソースになります。 警告ルールがトリガーされるときは、特定の SQL インスタンスまたはデータベースでトリガーされます。

注意

InsightsMetrics テーブルのデータセットに対してクエリを実行し、それらのクエリを警告ルールとして保存することによって、カスタムのログ警告ルールを作成することもできます。

Azure portal で、Azure Monitor メニューの [Insights] セクションから [SQL (プレビュー)] を選択します。 [Alerts] (アラート) を選択します。

Screenshot of the Azure Monitor page for SQL in the Azure portal. The Alerts button is highlighted.

ページの右側に [警告] ペインが開きます。 既定ではここに、既に作成した警告ルールに基づいて、選択した監視プロファイル内の SQL リソースに対して発生した警告が表示されます。 [警告テンプレート] を選択すると、警告ルールの作成に使用できるテンプレートの一覧が表示されます。

Screenshot of the Alerts page for Azure Monitor in the Azure portal. In the tab for Alert templates, a Create rule link for one of the alerts is highlighted.

[警告ルールの作成] ページで、ルールの既定の設定を確認し、必要に応じて編集します。 また、アクション グループを選択して、警告ルールがトリガーされたときの通知とアクションを作成することもできます。 すべてのプロパティを確認したら、[警告ルールを有効にする] を選択して警告ルールを作成します。

Screenshot of the Alert rules page for Azure Monitor in the Azure portal. The Create Alert rule (step 1 of 2) page shows the thresholds to use for alerts, the name and severity of the alert, and an alert group for notifications (optional).

警告ルールを直ちに展開するには、[警告ルールの展開] を選択します。 ルール テンプレートを実際に展開する前に表示する場合は、[テンプレートの表示] を選択します。

Screenshot of the Deploy alert rule page for Azure Monitor in the Azure portal. The Create Alert rule (step 2 of 2) page shows 'Ready to deploy your log alert' and the Deploy alert rule button is highlighted.

テンプレートを表示する場合は、[テンプレート] ページの [展開] を選択して、警告ルールを作成します。

Screenshot of the Deploy from view template page for Azure Monitor in the Azure portal, displaying the json of the alert. The Deploy menu button is highlighted.

次のステップ

Azure Monitor のアラートについて、さらに詳しく学習します。