测试 Microsoft Graph 连接器

可以使用 TestApp 实用工具 测试 Microsoft Graph 连接器。 这是一个控制台应用程序,用于在部署前测试连接器。 它不会创建任何连接或引入任何数据。

使用以下步骤测试连接器:

  1. 使用连接器 ID 和数据源路径更新 ConnectionInfo.json 文件,并将 AuthenticationKind 设置为 null。 此文件位于以下文件夹中:C:\Program Files\Graph 连接器代理\TestApp\Config。

    a. 提供程序 ID 是为每个项目生成的,位于 ConnectorInfoServiceImpl.cs 文件中。

    ConnectorInfoServiceImpl.cs 文件的屏幕截图,其中显示了提供程序 ID 的位置。

    b. 数据源路径是下载 ApplianceParts.csv 文件的路径。

    c. 可以将 AuthenticationKind 设置为 null ,因为连接器使用匿名身份验证。

    {
      // All these configs are only required to test locally
      "id": "TestGrpcConnector", // ConnectionId. Must be unique for a tenant. Change this for each crawlTest
      "name": "TestGrpcConnector", // name of connection
      "description": "\<Connection description>",
      "configuration": {
        "providerId": "a1c127ed-29ce-47fb-ad4a-8836871922ea", //Enter your ConnectorUniqueId
        "scheduleSetting": {
          "fullSyncInterval": 30 // the value is in seconds. Decrease this to run consecutive tests on the same connectionId
        },
        "CredentialData": {
          "Path": "D:\\ApplianceParts.csv",
          "AuthenticationKind": "Anonymous", // Authentication kind which connector supports eg: basic, windows, anonymous, oauth2.client_credentials
          "CredentialDetails": null // If AuthenticationKind is set to something different, use { "loginId": "", "loginSecret": "" } here
    
        },
        "ProviderParameters": null // This parameter will have the data/configuration given during connection creation time. Will be present in JSON serialized format
      }
    }
    
    
  2. 使用连接器的端口映射更新 CustomConnectorPortMap.json 文件。 此文件位于以下文件夹 C:\Program Files\Graph 连接器代理中。 使用在上一步) ConnectorInfoServiceImpl.cs文件中标识的连接器 ID (条目和端口(在 ConnectorServer.cs 文件中定义)更新此文件。

显示端口位置的ConnectorServer.cs文件的屏幕截图

    {
      "a1c127ed-29ce-47fb-ad4a-8836871922ea": "30303" //Update your ConnectorUniqueId and Port information
    }

  1. 更新位于以下文件夹中的manifest.json文件:C:\Program Files\Graph 连接器代理\TestApp\Config:
    {
    // This is your unique connector ID/provider ID.
    "connectorId": "a1c127ed-29ce-47fb-ad4a-8836871922ea", //Update your ConnectorUniqueId here
    
    // This is a list of all supported auth types. Remove the ones that the connector does not support.
    "authTypes": [ "Anonymous" ]   
    }

  1. 运行位于 C:\Program Files\Graph 连接器代理\TestApp 文件夹中的 GraphConnectorAgentTest.exe。

  2. 确保连接器正在运行。

  3. 使用 GraphConnectorAgentTest.exe 中 (1、2、3、4、5) 选项测试连接器。

后续步骤