レガシ Application Insights ブックを取得する

重要

プライベート ブックとレガシ ブックは非推奨となり、Azure portal からアクセスできません。 期限前に変換を忘れた非推奨のブックを探している場合は、このプロセスを使用して古いブックの内容を取得し、新しいブックに読み込むことができます。 このツールは、期間限定でのみ使用できます。

Application Insights ブック ("レガシ ブック" とも呼ばれます) は、他のすべての Azure ブックとは異なる Azure リソースの種類として格納されます。 これらの異なる Azure リソースの種類が 1 つの標準の種類にマージされ、標準の Azure Workbooks で使用可能なすべての既存の機能と新しい機能を活用できるようになりました。 次に例を示します。

  • 変換されたレガシ ブックでは、Azure Resource Graph (ARG) を使用してクエリを実行し、リソース グループまたはサブスクリプション内のリソースの他の標準の Azure ビューで表示できます。

  • 変換されたレガシ ブックでは、次のその他のリソースの種類のような最上位レベルの ARM テンプレート機能をサポートできます。

    • Tags
    • ポリシー
    • アクティビティ ログまたは変更履歴
    • リソース ロック
  • 変換されたレガシ ブックでは、ARM テンプレートをサポートできます。

  • 変換されたレガシ ブックでは、BYOS 機能をサポートできます。

  • 変換されたレガシ ブックは、選択したリージョンに保存できます。

レガシ ブックの非推奨化によって、Azure portal でブックを見つける場所は変更されません。 レガシ ブックは、Application Insights の [ブック] セクションに引き続き表示されます。 非推奨化はブックの内容には影響しません。

注意

  • 2021 年 4 月 15 日以降は、レガシ ブックを保存できなくなります。
  • レガシ ブックで Save as を使用して、標準の Azure ブックを作成します。
  • 作成する新しいブックは、標準のブックになります。

自動変換されないのはなぜですか?

  • レガシ ブックの書き込みアクセス許可は、Application Insights リソース自体に対する Azure ロールベースのアクセス制御にのみ基づいています。 ユーザーは、そのリソース グループに新しいブックを作成することができない可能性があります。 ブックが自動移行された場合は、ブックの移動に失敗する可能性があります。または、ブックを作成することはできても、その後にユーザーがブックを削除できない可能性があります。
  • レガシ ブックでは、Azure ブックではサポートされなくなった "マイ" (プライベート) ブックがサポートされています。 移行すると、それらのプライベート ブックは、その同じリソース グループへの読み取りアクセス権を持つユーザーにパブリックに表示されます。
  • 保存されたレガシ ブックから読み込まれたリンクまたはグループ コンテンツの使用が壊れる可能性があります。 作成者は、これらのリンクを手動で更新して、新しい保存済み項目をポイントする必要があります。

これらの理由から、ユーザーは保持するブックを手動で移行することをお勧めします。

レガシ Application Insights ブックを変換する

  1. レガシ ブックを特定します。 ギャラリー ビューでは、レガシ ブックに警告アイコンが表示されます。 レガシ ブックを開くと、バナーが表示されます。

    非推奨のブックの警告記号のスクリーンショット。

    非推奨のブック上部のバナーのスクリーンショット。

  2. レガシ ブックを変換します。 2021 年 6 月 30 日以降に保持するレガシ ブックの場合、次を行います。

    1. ブックを開き、ツール バーから [編集] を選択し、次に [名前を付けて保存] を選択します。
    2. ブック名を入力します。
    3. 書き込みアクセス権があるサブスクリプション、リソース グループ、リージョンを選択します。
    4. レガシ ブックで他のレガシ ブックへのリンクが使用されている場合、またはブックのコンテンツをグループに読み込む場合は、新しく保存されたブックをポイントするようにそれらの項目を更新する必要があります。
    5. ブックを保存したら、レガシ ブックを削除するか、その内容を新しく保存されたブックへのリンクとして更新できます。
  3. 権限を確認します。 レガシ ブックの場合、アクセス許可は Application Insights 共同作成者などの Application Insights 固有のロールに基づいていました。 新しいブックのユーザーが、適切なリソース グループでブックを表示および作成できるように、適切な標準の監視閲覧者または共同作成者ロールあるいはブック閲覧者または共同作成者ロールを持っていることを確認します。

詳細については、アクセス制御に関するページを参照してください。

レガシ ブックを非推奨にした後でも、Azure CLI または PowerShell ツールを使用してレガシ ブックのコンテンツを一定期間取得し、api-version=2015-05-01 を使用する特定のリソースに対して microsoft.insights/components/[name]/favorites のクエリを実行できます。

プライベート ブックを変換する

  1. 新しいブックまたは空のブックを開きます。

  2. ツール バーで [編集] を選択し、次に詳細エディターに移動します。

    非推奨のブックを取得するために使用される詳細エディターのスクリーンショット。

  3. ブックの json をコピーし、開いている詳細エディターに貼り付けます。

  4. 右上にある [適用] を選択します。

  5. 取得するブックのサブスクリプションとリソース グループとカテゴリを選択します。

  6. このブックの下部にあるグリッドには、選択したサブスクリプションまたはリソース グループ内のすべてのプライベート ブックが一覧表示されます。

  7. グリッド内のブックの 1 つを選択します。 ブックは、次のようになります。

    標準ブックに変換された非推奨のプライベート ブックのスクリーンショット。

  8. ブックの下部にある [ブックとしてコンテンツを開く] を選択します。

  9. 選択した古いプライベート ブックの内容を含む新しいブックが表示されます。 ブックを標準ブックとして保存します。

  10. 非推奨のブックまたはその内容へのリンク (ダッシュボード ピンや URL リンクなど) を再作成する必要があります。

お気に入りベースの (レガシ) ブックを変換する

  1. Application Insights の [リソースとブック] ギャラリーを参照します。
  2. 新しいブックまたは空のブックを開きます。
  3. ツール バーで [編集] を選択し、詳細エディターに移動します。

非推奨のブックを取得するために使用される詳細エディターのスクリーンショット。

  1. ブックの json をコピーし、開いている詳細エディターに貼り付けます。

  2. [適用] を選択します。

  3. このブックの下部にあるグリッドには、現在の AppInsights リソース内のすべてのレガシ ブックが一覧表示されます。

  4. グリッド内のブックの 1 つを選択します。 これで、ブックは次のようになるはずです。

    標準ブックに変換された非推奨のレガシ ブックのスクリーンショット。

  5. ブックの下部にある [ブックとしてコンテンツを開く] を選択します。

  6. 選択した古いプライベート ブックの内容を含む新しいブックが表示されます。 ブックを標準ブックとして保存します。

  7. 非推奨のブックまたはその内容へのリンク (ダッシュボード ピンや URL リンクなど) を再作成する必要があります。

レガシ ブック変換用の JSON

{
  "version": "Notebook/1.0",
  "items": [
    {
      "type": 9,
      "content": {
        "version": "KqlParameterItem/1.0",
        "parameters": [
          {
            "id": "876235fc-ef67-418d-87f5-69f496be171b",
            "version": "KqlParameterItem/1.0",
            "name": "resource",
            "type": 5,
            "typeSettings": {
              "additionalResourceOptions": [
                "value::1"
              ],
              "componentIdOnly": true
            },
            "timeContext": {
              "durationMs": 86400000
            },
            "defaultValue": "value::1"
          }
        ],
        "style": "pills",
        "queryType": 0,
        "resourceType": "microsoft.insights/components"
      },
      "conditionalVisibility": {
        "parameterName": "debug",
        "comparison": "isNotEqualTo"
      },
      "name": "resource selection"
    },
    {
      "type": 1,
      "content": {
        "json": "# Legacy (Favorites based) Workbook Conversion\r\n\r\nThis workbook shows favorite based (legacy) workbooks in this Application Insights resource: \r\n\r\n{resource:grid}\r\n\r\nThe grid below will show the favorite workbooks found, and allows you to copy the contents, or open them as a full Azure Workbook where they can be saved."
      },
      "name": "text - 5"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GETARRAY\",\"path\":\"{resource}/favorites\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2015-05-01\"},{\"key\":\"sourceType\",\"value\":\"notebook\"},{\"key\":\"canFetchContent\",\"value\":\"false\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"columns\":[{\"path\":\"$.Name\",\"columnid\":\"name\"},{\"path\":\"$.FavoriteId\",\"columnid\":\"id\"},{\"path\":\"$.TimeModified\",\"columnid\":\"modified\",\"columnType\":\"datetime\"},{\"path\":\"$.FavoriteType\",\"columnid\":\"type\"}]}}]}",
        "size": 0,
        "title": "Legacy Workbooks (Select an item to see contents)",
        "noDataMessage": "No legacy workbooks found",
        "noDataMessageStyle": 3,
        "exportedParameters": [
          {
            "fieldName": "id",
            "parameterName": "favoriteId"
          },
          {
            "fieldName": "name",
            "parameterName": "name",
            "parameterType": 1
          }
        ],
        "queryType": 12,
        "gridSettings": {
          "rowLimit": 1000,
          "filter": true
        }
      },
      "name": "list favorites"
    },
    {
      "type": 9,
      "content": {
        "version": "KqlParameterItem/1.0",
        "parameters": [
          {
            "id": "8d78556d-a4f3-4868-bf06-9e0980246d31",
            "version": "KqlParameterItem/1.0",
            "name": "config",
            "type": 1,
            "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"{resource}/favorites/{favoriteId}\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2015-05-01\"},{\"key\":\"sourceType\",\"value\":\"notebook\"},{\"key\":\"canFetchContent\",\"value\":\"true\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"columns\":[{\"path\":\"$.Config\",\"columnid\":\"Content\"}]}}]}",
            "timeContext": {
              "durationMs": 86400000
            },
            "queryType": 12
          }
        ],
        "style": "pills",
        "queryType": 12
      },
      "conditionalVisibility": {
        "parameterName": "debug",
        "comparison": "isNotEqualTo"
      },
      "name": "turn response into param"
    },
    {
      "type": 11,
      "content": {
        "version": "LinkItem/1.0",
        "style": "list",
        "links": [
          {
            "id": "fc93ee9e-d5b2-41de-b74a-1fb62f0df49e",
            "linkTarget": "OpenBlade",
            "linkLabel": "Open Content as Workbook",
            "style": "primary",
            "bladeOpenContext": {
              "bladeName": "UsageNotebookBlade",
              "extensionName": "AppInsightsExtension",
              "bladeParameters": [
                {
                  "name": "ComponentId",
                  "source": "parameter",
                  "value": "resource"
                },
                {
                  "name": "NewNotebookData",
                  "source": "parameter",
                  "value": "config"
                }
              ]
            }
          }
        ]
      },
      "conditionalVisibility": {
        "parameterName": "config",
        "comparison": "isNotEqualTo"
      },
      "name": "links - 4"
    }
  ],
  "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}

プライベート ブック変換用の JSON

{
  "version": "Notebook/1.0",
  "items": [
    {
      "type": 9,
      "content": {
        "version": "KqlParameterItem/1.0",
        "crossComponentResources": [
          "{Subscription}"
        ],
        "parameters": [
          {
            "id": "1f74ed9a-e3ed-498d-bd5b-f68f3836a117",
            "version": "KqlParameterItem/1.0",
            "name": "Subscription",
            "type": 6,
            "isRequired": true,
            "typeSettings": {
              "additionalResourceOptions": [
                "value::1"
              ],
              "includeAll": false,
              "showDefault": false
            }
          },
          {
            "id": "b616a3a3-4271-4208-b1a9-a92a78efed08",
            "version": "KqlParameterItem/1.0",
            "name": "ResourceGroup",
            "label": "Resource group",
            "type": 2,
            "isRequired": true,
            "query": "Resources\r\n| summarize by resourceGroup\r\n| order by resourceGroup asc\r\n| project id=resourceGroup, resourceGroup",
            "crossComponentResources": [
              "{Subscription}"
            ],
            "typeSettings": {
              "additionalResourceOptions": [
                "value::1"
              ],
              "showDefault": false
            },
            "queryType": 1,
            "resourceType": "microsoft.resourcegraph/resources"
          },
          {
            "id": "3872fc90-1467-4b01-81ef-d82d90665d72",
            "version": "KqlParameterItem/1.0",
            "name": "Category",
            "type": 2,
            "description": "Workbook Category",
            "isRequired": true,
            "typeSettings": {
              "additionalResourceOptions": [],
              "showDefault": false
            },
            "jsonData": "[\"workbook\",\"sentinel\",\"usage\",\"tsg\",\"usageMetrics\",\"workItems\",\"performance-websites\",\"performance-appinsights\",\"performance-documentdb\",\"performance-storage\",\"performance-storageclassic\",\"performance-vm\",\"performance-vmclassic\",\"performance-sqlserverdatabases\",\"performance-virtualnetwork\",\"performance-virtualmachinescalesets\",\"performance-computedisks\",\"performance-networkinterfaces\",\"performance-logicworkflows\",\"performance-appserviceplans\",\"performance-applicationgateway\",\"performance-runbooks\",\"performance-servicebusqueues\",\"performance-iothubs\",\"performance-networkroutetables\",\"performance-cognitiveserviceaccounts\",\"performance-containerservicemanagedclusters\",\"performance-servicefabricclusters\",\"performance-cacheredis\",\"performance-eventhubnamespaces\",\"performance-hdinsightclusters\",\"failure-websites\",\"failure-appinsights\",\"failure-documentdb\",\"failure-storage\",\"failure-storageclassic\",\"failure-vm\",\"failure-vmclassic\",\"failure-sqlserverdatabases\",\"failure-virtualnetwork\",\"failure-virtualmachinescalesets\",\"failure-computedisks\",\"failure-networkinterfaces\",\"failure-logicworkflows\",\"failure-appserviceplans\",\"failure-applicationgateway\",\"failure-runbooks\",\"failure-servicebusqueues\",\"failure-iothubs\",\"failure-networkroutetables\",\"failure-cognitiveserviceaccounts\",\"failure-containerservicemanagedclusters\",\"failure-servicefabricclusters\",\"failure-cacheredis\",\"failure-eventhubnamespaces\",\"failure-hdinsightclusters\",\"storage-insights\",\"cosmosdb-insights\",\"vm-insights\",\"container-insights\",\"keyvaults-insights\",\"backup-insights\",\"rediscache-insights\",\"servicebus-insights\",\"eventhub-insights\",\"workload-insights\",\"adxcluster-insights\",\"wvd-insights\",\"activitylog-insights\",\"hdicluster-insights\",\"laws-insights\",\"hci-insights\"]",
            "defaultValue": "workbook"
          }
        ],
        "queryType": 1,
        "resourceType": "microsoft.resourcegraph/resources"
      },
      "name": "resource selection"
    },
    {
      "type": 1,
      "content": {
        "json": "# Private Workbook Conversion\r\n\r\nThis workbook shows private workbooks within the current subscription / resource group: \r\n\r\n| Subscription | Resource Group | \r\n|--------------|----------------|\r\n|{Subscription}|{ResourceGroup} |\r\n\r\nThe grid below will show the private workbooks found, and allows you to copy the contents, or open them as a full Azure Workbook where they can be saved.\r\n\r\nUse the button below to load the selected private workbook content into a new workbook. From there you can save it as a new workbook."
      },
      "name": "text - 5"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GETARRAY\",\"path\":\"/{Subscription}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/myworkbooks\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2020-10-20\"},{\"key\":\"category\",\"value\":\"{Category}\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$..[?(@.kind == \\\"user\\\")]\",\"columns\":[{\"path\":\"$.properties.displayName\",\"columnid\":\"name\"},{\"path\":\"$.name\",\"columnid\":\"id\"},{\"path\":\"$.kind\",\"columnid\":\"type\",\"columnType\":\"string\"},{\"path\":\"$.properties.timeModified\",\"columnid\":\"modified\",\"columnType\":\"datetime\"},{\"path\":\"$.properties.sourceId\",\"columnid\":\"resource\",\"columnType\":\"string\"}]}}]}",
        "size": 1,
        "title": "Private Workbooks",
        "noDataMessage": "No private workbooks found",
        "noDataMessageStyle": 3,
        "exportedParameters": [
          {
            "fieldName": "id",
            "parameterName": "id"
          },
          {
            "fieldName": "name",
            "parameterName": "name",
            "parameterType": 1
          },
          {
            "fieldName": "resource",
            "parameterName": "resource",
            "parameterType": 1
          }
        ],
        "queryType": 12,
        "gridSettings": {
          "formatters": [
            {
              "columnMatch": "resource",
              "formatter": 13,
              "formatOptions": {
                "linkTarget": null,
                "showIcon": true
              }
            }
          ],
          "rowLimit": 1000,
          "filter": true,
          "labelSettings": [
            {
              "columnId": "resource",
              "label": "Linked To"
            }
          ]
        },
        "sortBy": []
      },
      "name": "list private workbooks"
    },
    {
      "type": 9,
      "content": {
        "version": "KqlParameterItem/1.0",
        "parameters": [
          {
            "id": "8d78556d-a4f3-4868-bf06-9e0980246d31",
            "version": "KqlParameterItem/1.0",
            "name": "config",
            "type": 1,
            "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"{Subscription}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/myworkbooks/{id}\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2020-10-20\"},{\"key\":\"sourceType\",\"value\":\"notebook\"},{\"key\":\"canFetchContent\",\"value\":\"true\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"columns\":[{\"path\":\"$..serializedData\",\"columnid\":\"Content\"}]}}]}",
            "timeContext": {
              "durationMs": 86400000
            },
            "queryType": 12
          }
        ],
        "style": "pills",
        "queryType": 12
      },
      "conditionalVisibility": {
        "parameterName": "debug",
        "comparison": "isNotEqualTo"
      },
      "name": "turn response into param"
    },
    {
      "type": 11,
      "content": {
        "version": "LinkItem/1.0",
        "style": "list",
        "links": [
          {
            "id": "fc93ee9e-d5b2-41de-b74a-1fb62f0df49e",
            "linkTarget": "OpenBlade",
            "linkLabel": "Open Content as Workbook",
            "style": "primary",
            "bladeOpenContext": {
              "bladeName": "UsageNotebookBlade",
              "extensionName": "AppInsightsExtension",
              "bladeParameters": [
                {
                  "name": "ComponentId",
                  "source": "parameter",
                  "value": "resource"
                },
                {
                  "name": "NewNotebookData",
                  "source": "parameter",
                  "value": "config"
                }
              ]
            }
          }
        ]
      },
      "conditionalVisibility": {
        "parameterName": "config",
        "comparison": "isNotEqualTo"
      },
      "name": "links - 4"
    }
  ],
  "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}