activities
latest
false
生产力活动
Last updated 2024年9月13日

Set up your Microsoft 365 Azure application

要启用 Microsoft 365 传统活动,您的应用程序必须与 Microsoft 身份平台集成,并获配正确的 Microsoft Graph API 权限

要集成应用程序、分配权限并开始构建自动化项目,请完成以下步骤:

  1. 注册您的应用程序。
  2. 添加 API 权限。
  3. 构建项目。

注册 Microsoft 365 应用程序后,Azure Active Directory 会分配您在Microsoft 365 作用域活动中输入的唯一应用程序(客户端)ID,以及您分配权限的服务(例如,文件、邮件、日历)。



注册您的应用程序

Tip: This process is described in detail in the Microsoft documentation in Quickstart: Register an application with the Microsoft identity platform. Please note that the Microsoft UI may have changed since these steps were first documented.
  1. 使用您的个人、工作或学校 Microsoft 365 帐户登录 Azure 门户
  2. 在左侧导航面板中,单击“ Azure Active Directory”。
  3. Azure Active Directory 页面打开后,单击“ 应用程序注册” 。
  4. 单击顶部导航栏中的“ + 新注册 ”。

  5. 输入应用程序的 名称 (例如,“Office365App”)。
  6. Under Supported account types, select the option that applies to you. For more information about which option to select, refer to Who can sign in to you app?:

    • Accounts in this organizational directory only - Use this option if your target audience is internal to your organization. This represents a single tenant application.
    • Accounts in any organizational directory (Any Azure AD directory - Multitenant) - Use this option if your target audience is business or educational customers. This represents a multitenant application.
    • Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox) - Use this option to target the widest set of Microsoft identities. This represents a multitenant application.
  7. Under Redirect URI (optional), enter a URI address (if applicable). The Microsoft Authentication Library (MSAL.NET) uses a default redirect URI: https://login.microsoftonline.com/common/oauth2/nativeclient. This value will likely work for you when using the Interactive Token authentication type.
    • Your selection is dependent on your authentication type. For more information on this topic, see How to connect to Microsoft 365 activities).
    • In our example, the organization supports multi-tenant authentication and can only use the Interactive Token authentication type which requires a redirect URI.
      • If you use Interactive Token and the default Microsoft Redirect URI, you must add a platform of type Mobile and desktop applications. For more information, see Configure platform settings in the Microsoft documentation.
      • If your authentication type is Integrated Windows Authentication or Username and Password, you don't need to register a redirect URI for your application. These flows do a round trip to the Microsoft identity platform v2.0 endpoint, and your application won't be called back on any specific URI.
    • When working with Microsoft 365 in a UiPath Studio project targeting .NET 5.0, add http://localhost to the Redirect URI of your custom applications.

      有关详细信息,请参阅 Microsoft 标识平台文档中的 桌面应用程序注册

  8. Select Register. An example configuration is available in the image below.
    注意: 此设置只是一个示例。 请按照文档中所述的步骤操作,并根据组织的策略进行选择。


操作完毕! 现在,我们向已注册的应用程序添加 API 权限。

添加 API 权限

  1. 在已注册的应用程序页面( Azure 门户 > Azure Active Directory > 应用注册 > Office365App )中,在左侧导航面板中选择“ API 权限”。
  2. “API 权限”页面打开后,单击“ + 添加权限 ”(这将打开“ 请求 API 权限 ”窗口)。
  3. 在“ 选择 API” 下,单击“ Microsoft API ”(默认情况下可能处于打开状态)。
  4. 在“ 常用 Microsoft API”下,单击“ Microsoft Graph”。

  5. Under What type of permissions does your application require?, click Delegated permissions or Application permissions to show the list of permissions. Select Application permissions if you are using ApplicationIdAndSecret or ApplicationIdAndCertificate authentication type. The other authentication types available in Microsoft 365 Scope activity require Delegated permissions.

    有关权限类型的更多信息,请参阅 Microsoft Azure 文档中的 配置客户端应用程序以访问 Web API

  6. 使用搜索栏或向下滚动按字母顺序排列的列表,然后选择以下权限:
    Note: These permissions are not all mandatory. The provided list represents the complete set of permissions required to run all Microsoft 365 activities. You can restrict permissions depending on your particular use case. Check out the activities documentation pages to learn what permissions they need.
    • 日历

      • 日历. 读取
      • Calendars.ReadWrite
    • 文件

      • 文件。读取
      • 文件读取全部
      • Files.ReadWrite
      • Files.ReadWrite.All
    • 网站

      • 站点。只读。全部
      • Sites.ReadWrite.All
    • 邮件

      • 邮件读取
      • 邮件读写
      • 邮件.发送
    • 用户
      • User.Read
    • Shared (scopes needed to access resources that are shared with, but not owned by, the user.)

      • 邮件读取共享
      • 邮件读写共享
      • 邮件.发送.共享
      • Calendars.Read.Shared
      • Calendars.ReadWrite.Shared
    • Select Add permissions to return to your list of API permissions.



  7. Make sure your API permissions include your added Calendars, Files, User, and Mail permissions.



在桌面版 Studio 中构建项目

  1. 创建一个新的自动化项目。

    1. 打开 UiPath Studio

    2. Under New Project, click Process. This opens a New Blank Process window.

    3. 输入项目 名称位置说明

    4. 选择“ 兼容性”。 默认情况下选择“Windows”。

    5. 单击“创建”。

  2. 安装 UiPath.MicrosoftOffice365.Activities 包。

    1. From the Design ribbon, select Manage Packages.
    2. 在“ 所有包”下的“ 搜索” 栏中,输入 Office 365Microsoft
    3. Select the package version you want, then select Install.
    4. 单击保存按钮。
    有关 UiPath Studio 包的更多信息,请参阅 Studio 指南中的 管理包

操作完毕!现在,您已完成设置,可以开始将 Microsoft 365 活动添加到项目中。

后续步骤

如需动手学习体验并快速开始使用这些活动,请参阅 快速入门 指南。 这些指南提供分步说明,以帮助您创建不同活动的工作示例,以便您可以验证与已注册应用程序的连接并熟悉输入/输出属性。

To learn more about the Microsoft 365 activities (including example property inputs/outputs), see the Classic activities for a complete list and links to the activity detailed pages.

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
信任与安全
© 2005-2024 UiPath。保留所有权利。