Microsoft 365 用統合アプリ マニフェストを含む Office アドイン

この記事では、Microsoft 365 の統合アプリ マニフェストについて説明します。 Office アドイン マニフェストについて理解していることを前提としています。

ヒント

Microsoft は、Microsoft 365開発者プラットフォームについて多くの改善を行っています。 これらの機能強化により、Office アドインを含む、Microsoft 365 のすべての種類の拡張機能の開発、展開、インストール、および管理の一貫性が向上します。これらの変更は、既存のアドインと互換性があります。

重要な改善点の 1 つは、同じマニフェスト形式とスキーマを使用して、すべての Microsoft 365 拡張機能に対して単一の配布単位を作成できることです。

Microsoft 365 用の統合マニフェストを使用して Outlook アドインを作成できるようにすることで、これらの目標に向けた重要な第一歩を踏み出しました。

注:

  • 統合マニフェストは現在、Outlook アドインのみをサポートしており、Office では Microsoft 365 サブスクリプションにリンクされ、Windows、モバイル デバイス、またはOutlook on the webにインストールされています。 Excel、PowerPoint、Word、Outlook on Mac、および永続的なバージョンの Office へのサポートの拡張に取り組んでいます。
  • 統合マニフェストには、Office バージョン 2304 (ビルド 16320.00000) 以降が必要です。

ヒント

統合マニフェストの使用を開始する準備はできましたか? 「 Microsoft 365 用の統合マニフェストを使用して Outlook アドインをビルドする」から始めます。

統合マニフェストの主要なプロパティ

統合アプリ マニフェストのバージョンに関するメインリファレンス ドキュメントはマニフェスト スキーマにあります。 この記事では、重要な基本マニフェスト プロパティに関する情報を提供しますが、"extensions" プロパティのドキュメントは含まれていない場合があります。これは、Office アドインが統合マニフェストで構成されているプロパティです。 そのため、この記事では、Teams アプリが Office アドインである (または含まれている) 場合の基本プロパティの意味について簡単に説明します。 その後、"extensions" プロパティとその子孫プロパティに関する基本的なドキュメントが続きます。 アドインの完全なサンプル マニフェストについては、「 サンプル統合マニフェスト」を参照してください。

基本プロパティ

次の表に示す各基本プロパティには、 マニフェスト スキーマに関するより広範なドキュメントがあります。 この表に含まれていない基本プロパティは、Office アドインには意味がありません。

JSON プロパティ 用途
"$schema" マニフェスト スキーマを識別します。
"manifestVersion" マニフェスト スキーマのバージョンです。
"id" Teams アプリ/アドインの GUID。
"version" Teams アプリ/アドインのバージョン。 形式は、 n.n.n それぞれ n 5 桁以下にする必要があります。
"name" Teams アプリ/アドインのパブリックの短い名前と長い名前。 短い名前がアドインの作業ウィンドウの上部に表示されます。
"description" Teams アプリ/アドインの短い説明と長い説明を公開します。
"developer" Teams アプリ/アドインの開発者に関する情報。
"localizationInfo" 既定のロケールとその他のサポートされているロケールを構成します。
"validDomains" セーフ ドメインを指定する」を参照してください。
"webApplicationInfo" Azure Active Directory で認識されている Teams アプリ/アドインの Web アプリを識別します。
"authorization" アドインに必要な Microsoft Graphアクセス許可を識別します。

"extensions" プロパティ

"extensions" プロパティとその子孫プロパティに関するリファレンス ドキュメントを完成させるために、一生懸命取り組んでいます。 それまでの間、次に示すいくつかの基本的なドキュメントを示します。 すべてのプロパティではなく、ほとんどのプロパティには、アドインの XML マニフェストに同等の要素 (または属性) があります。ほとんどの場合、XML 要素または属性に適用される説明と制限は、統合マニフェストで同等の JSON プロパティにも適用されます。 「 Xml マニフェストと Microsoft 365 の統合マニフェストを比較 する」の「拡張機能」プロパティセクションのテーブルは、JSON プロパティと同等の XML を判断するのに役立ちます。

JSON プロパティ 用途
"requirements.capabilities" アドインをインストール可能にする必要がある 要件セット を識別します。
"requirements.scopes" アドインをインストールできる Office アプリケーションを識別します。 たとえば、"メール" とは、アドインを Outlook にインストールできることを意味します。
"ribbons" アドインがカスタマイズするリボン。
"ribbons.contexts" アドインがカスタマイズするコマンド サーフェスを指定します。 たとえば、"mailRead" や "mailCompose" などです。
"ribbons.tabs" カスタム リボン タブを構成します。
"alternates" 同等の COM アドイン、XLL、またはその両方との下位互換性を指定します。 また、古いバージョンの Office のアドインを表すために使用されるメインアイコンも指定します。
"runtimes" カスタム関数専用アドインや関数コマンドなど、UI がほとんどまたはまったくないさまざまな種類のアドインなど、アドインで使用される埋め込みランタイムを構成します。
"autoRunEvents" 指定したイベントのイベント ハンドラーを構成します。

セーフ ドメインを指定する

マニフェスト ファイルには "validDomains" 配列があり、アドインの移動を許可するドメインを Office に伝えるために使用されます。 「アドイン ウィンドウで開くドメインを指定する」で示されているように、Office on the webで実行する場合は、作業ウィンドウを任意の URL に移動できます。 ただし、デスクトップ プラットフォームでは、アドインがスタート ページをホストするドメイン以外のドメインの URL に移動しようとすると、その URL は Office アプリケーションのアドイン ウィンドウの外側の新しいブラウザー ウィンドウで開きます。

デスクトップ プラットフォームでこの動作をオーバーライドするには、アドイン ウィンドウで開く各ドメインを、"validDomains" 配列で指定されたドメインの一覧に追加します。 アドインがこの一覧にあるドメインの URL に移動しようとすると、Office on the web とデスクトップの Office の両方の作業ウィンドウで開きます。 一覧にない URL に移動しようとすると、Office on desktop で、その URL が新しいブラウザー ウィンドウ (アドイン作業ウィンドウの外側) で開きます。

統合マニフェストのサンプル

アドインの統合アプリ マニフェストの例を次に示します。

{
  "$schema": "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/op/extensions/MicrosoftTeams.schema.json",
  "id": "00000000-0000-0000-0000-000000000000",
  "version": "1.0.0",
  "manifestVersion": "devPreview",
  "name": {
    "short": "Name of your app (<=30 chars)",
    "full": "Full name of app, if longer than 30 characters (<=100 chars)"
  },
  "description": {
    "short": "Short description of your app (<= 80 chars)",
    "full": "Full description of your app (<= 4000 chars)"
  },
  "icons": {
    "outline": "outline.png",
    "color": "color.png"
  },
  "accentColor": "#230201",
  "developer": {
    "name": "Contoso",
    "websiteUrl": "https://www.contoso.com",
    "privacyUrl": "https://www.contoso.com/privacy",
    "termsOfUseUrl": "https://www.contoso.com/servicesagreement"
  },
  "localizationInfo": {
    "defaultLanguageTag": "en-us",
    "additionalLanguages": [
      {
        "languageTag": "es-es",
        "file": "es-es.json"
      }
    ]
  },
  "webApplicationInfo": {
    "id": "00000000-0000-0000-0000-000000000000",
    "resource": "api://www.contoso.com/prodapp"
  },
  "authorization": {
    "permissions": {
      "resourceSpecific": [
        {
          "name": "Mailbox.ReadWrite.User",
          "type": "Delegated"
        }
      ]
    }
  },
  "extensions": [
    {
      "requirements": {
        "scopes": [ "mail" ],
        "capabilities": [
          {
            "name": "Mailbox", "minVersion": "1.1"
          }
        ]
      },
      "runtimes": [
        {
          "requirements": {
            "capabilities": [
              {
                "name": "MailBox", "minVersion": "1.10"
              }
            ]
          },
          "id": "eventsRuntime",
          "type": "general",
          "code": {
            "page": "https://contoso.com/events.html",
            "script": "https://contoso.com/events.js"
          },
          "lifetime": "short",
          "actions": [
            {
              "id": "onMessageSending",
              "type": "executeFunction"
            },
            {
              "id": "onNewMessageComposeCreated",
              "type": "executeFunction"
            }
          ]
        },
        {
          "requirements": {
            "capabilities": [
              {
                "name": "MailBox", "minVersion": "1.1"
              }
            ]
          },
          "id": "commandsRuntime",
          "type": "general",
          "code": {
            "page": "https://contoso.com/commands.html",
            "script": "https://contoso.com/commands.js"
          },
          "lifetime": "short",
          "actions": [
            {
              "id": "action1",
              "type": "executeFunction"
            },
            {
              "id": "action2",
              "type": "executeFunction"
            },
            {
              "id": "action3",
              "type": "executeFunction"
            }
          ]
        }
      ],
      "ribbons": [
        {
          "contexts": [
            "mailCompose"
          ],
          "tabs": [
            {
              "builtInTabId": "TabDefault",
              "groups": [
                {
                  "id": "dashboard",
                  "label": "Controls",
                  "controls": [
                    {
                      "id": "control1",
                      "type": "button",
                      "label": "Action 1",
                      "icons": [
                        {
                          "size": 16,
                          "url": "test_16.png"
                        },
                        {
                          "size": 32,
                          "url": "test_32.png"
                        },
                        {
                          "size": 80,
                          "url": "test_80.png"
                        }
                      ],
                      "supertip": {
                        "title": "Action 1 Title",
                        "description": "Action 1 Description"
                      },
                      "actionId": "action1"
                    },
                    {
                      "id": "menu1",
                      "type": "menu",
                      "label": "My Menu",
                      "icons": [
                        {
                          "size": 16,
                          "url": "test_16.png"
                        },
                        {
                          "size": 32,
                          "url": "test_32.png"
                        },
                        {
                          "size": 80,
                          "url": "test_80.png"
                        }
                      ],
                      "supertip": {
                        "title": "My Menu",
                        "description": "Menu with 2 actions"
                      },
                      "items": [
                        {
                          "id": "menuItem1",
                          "type": "menuItem",
                          "label": "Action 2",
                          "supertip": {
                            "title": "Action 2 Title",
                            "description": "Action 2 Description"
                          },
                          "actionId": "action2"
                        },
                        {
                          "id": "menuItem2",
                          "type": "menuItem",
                          "label": "Action 3",
                          "icons": [
                            {
                              "size": 16,
                              "url": "test_16.png"
                            },
                            {
                              "size": 32,
                              "url": "test_32.png"
                            },
                            {
                              "size": 80,
                              "url": "test_80.png"
                            }
                          ],
                          "supertip": {
                            "title": "Action 3 Title",
                            "description": "Action 3 Description"
                          },
                          "actionId": "action3"
                        }
                      ]
                    }
                  ]
                }
              ],
            }
          ]
        },
        {
          "contexts": [ "mailRead" ],
          "tabs": [
            {
              "builtInTabId": "TabDefault",
              "groups": [
                {
                  "id": "dashboard",
                  "label": "Controls",
                  "controls": [
                    {
                      "id": "control1",
                      "type": "button",
                      "label": "Action 1",
                      "icons": [
                        {
                          "size": 16,
                          "url": "test_16.png"
                        },
                        {
                          "size": 32,
                          "url": "test_32.png"
                        },
                        {
                          "size": 80,
                          "url": "test_80.png"
                        }
                      ],
                      "supertip": {
                        "title": "Action 1 Title",
                        "description": "Action 1 Description"
                      },
                      "actionId": "action1"
                    }
                  ]
                }
              ],
              "customMobileRibbonGroups" [
                {
                  "id": "myMobileGroup",
                  "label": "Contoso Actions",
                  "controls": [
                    {
                      "id": "msgReadFunctionButton",
                      "type": "MobileButton",
                      "label": "Action 1",
                      "icons": [
                        {
                          "size": 16,
                          "url": "test_16.png"
                        },
                        {
                          "size": 32,
                          "url": "test_32.png"
                        },
                        {
                          "size": 80,
                          "url": "test_80.png"
                        }
                      ],
                      "supertip": {
                        "title": "Action 1 Title",
                        "description": "Action 1 Description"
                      },
                      "actionId": "action1"
                    }
                  ]
                }
              ]
              "customMobileRibbonGroups": [
                {
                  "id": "mobileDashboard",
                  "label": "Controls",
                  "controls": [
                    {
                      "id": "control1",
                      "type": "MobileButton",
                      "label": "Action 1",
                      "icons": [
                        {
                          "size": 16,
                          "url": "test_16.png"
                        },
                        {
                          "size": 32,
                          "url": "test_32.png"
                        },
                        {
                          "size": 80,
                          "url": "test_80.png"
                        }
                      ],
                      "supertip": {
                        "title": "Action 1 Title",
                        "description": "Action 1 Description"
                      },
                      "actionId": "action1"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "autoRunEvents": [
        {
          "requirements": {
            "capabilities": [
              {
                "name": "MailBox", "minVersion": "1.10"
              }
            ]
          },
          "events": [
            {
              "type": "newMessageComposeCreated",
              "actionId": "onNewMessageComposeCreated"
            },
            {
              "type": "messageSending",
              "actionId": "onMessageSending",
              "options": {
                "sendMode": "promptUser"
              }
            }
          ]
        }
      ],
      "alternates": [
        {
          "requirements": {
            "scopes": [ "mail" ]
          },
          "prefer": {
            "comAddin": {
              "progId": "ContosoExtension"
            }
          },
          "hide": {
            "storeOfficeAddin": {
              "officeAddinId": "00000000-0000-0000-0000-000000000000",
              "assetId": "WA000000000"
            }
          },
          "alternateIcons": {
            "icon": {
              "size": 64,
              "url": "https://contoso.com/assets/icon64x64.jpg"
            },
            "highResolutionIcon": {
              "size": 64,
              "url": "https://contoso.com/assets/icon128x128.jpg"
            }
          }
          "alternateIcons": {
            "icon": {
              "size": 16,
              "url": "https://cdn.contoso.com/resources/icon64.jpg"
            },
            "highResolutionIcon": {
              "size": 16,
              "url": "https://cdn.contoso.com/resources/icon128.jpg"
            },
          }
        }
      ]
    }
  ]
}

関連項目