使用 PowerShell 创建应用

适用于: 拥有租户管理员 - SharePoint Embedded 管理员/全局管理员

使用 SharePoint PowerShell 为应用创建 SharePoint Embedded 容器类型。 每个容器类型都与一个Microsoft Entra应用程序相关联。

开始之前

请确保:

  • SharePoint Embedded 管理员或全局管理员角色。
  • 最新SharePoint Online 命令行管理程序。
  • 拥有容器类型的Microsoft Entra应用程序 ID。
  • 对于标准计费设置,Azure订阅的所有者或参与者权限。

重要

创建容器类型时,选择计费方法。 创建后无法更改计费方法。

创建标准计费应用

当拥有应用程序的组织为 SharePoint Embedded 使用量付费时,请使用标准计费。

New-SPOContainerType -ContainerTypeName <ContainerTypeName> -OwningApplicationId <OwningApplicationId>

通过分配Azure订阅、资源组和区域来设置标准容器类型的计费。

Add-SPOContainerTypeBilling -ContainerTypeId <ContainerTypeId> -AzureSubscriptionId <AzureSubscriptionId> -ResourceGroup <ResourceGroup> -Region <Region>

创建直通计费应用

当使用租户为 SharePoint Embedded 使用量付费时,请使用直通计费,也称为直接到客户计费。

New-SPOContainerType -IsPassThroughBilling -ContainerTypeName <ContainerTypeName> -OwningApplicationId <OwningApplicationId>

对于直通计费,使用租户管理员必须设置Microsoft 365 即用即付服务,然后用户才能访问应用。 有关详细信息,请参阅在 Microsoft 365 管理中心 中设置计费

创建试用应用

使用试用应用进行评估和概念证明工作。

New-SPOContainerType -TrialContainerType -ContainerTypeName <ContainerTypeName> -OwningApplicationId <OwningApplicationId>

试用应用有效期为 30 天。

查看应用

列出在拥有租户中创建的 SharePoint Embedded 应用程序。

Get-SPOContainerType
Get-SPOContainerType -ContainerTypeId <ContainerTypeId>

更新应用属性

更新支持的容器类型属性。

Set-SPOContainerType -ContainerTypeId <ContainerTypeId>
                     [-ContainerTypeName <ContainerTypeName>]
                     [-WhatIf] [-Confirm]

配置应用行为

配置支持的容器类型设置,例如可发现性和共享限制。

Set-SPOContainerTypeConfiguration -ContainerTypeId <ContainerTypeId> -DiscoverabilityDisabled $true
Set-SPOContainerTypeConfiguration -ContainerTypeId <ContainerTypeId> -SharingRestricted $true

查看当前配置。

Get-SPOContainerTypeConfiguration -ContainerTypeId <ContainerTypeId>

后续步骤

在租户中安装应用程序: 安装 SharePoint Embedded 应用