SharePoint 框架解决方案的租户范围内解决方案部署Tenant-scoped solution deployment for SharePoint Framework solutions

可以将 SharePoint 框架组件配置为,在解决方案包安装到租户应用程序目录时,立即可用于整个租户。You can configure your SharePoint Framework components to be immediately available across the tenant when the solution package is installed to the tenant app catalog. 可以使用 package-solution.json 文件中的 skipFeatureDeployment 属性,对此进行配置。This can be configured by using the skipFeatureDeployment attribute in the package-solution.json file.

如果解决方案启用此属性,租户管理员就可以将解决方案启用为,在解决方案包安装到租户应用程序目录时,自动可用于租户中的所有网站集和网站。When the solution has this attribute enabled, the tenant administrator is provided the option to enable the solution to be available automatically across all site collections and sites in the tenant when the solution package is installed to the tenant app catalog.

也可以观看 SharePoint PnP YouTube 频道上的以下视频,了解所介绍的租户范围内部署选项:You can also see the tenant-wide deployment option demonstrated by watching the following video on the SharePoint PnP YouTube Channel:



备注

必须更新到最新版本的 SharePoint 框架 Yeoman 模板才能使用此功能。You have to update to the latest SharePoint Framework Yeoman template version to be able to use this capability. 可以通过执行 npm install -g @microsoft/generator-sharepoint 更新全局安装。You can update your global installation by executing npm install -g @microsoft/generator-sharepoint. 租户范围内部署不适用于 SharePoint 2016 功能包 2,因为它仅支持 SPFX 1.1,而此部署选项在版本 1.4 中发布。若在使用低于版本 1.4 的 SPFX Web 部件,可以按照说明使用适用于 Microsoft 365 的 CLI 进行升级Tenant-wide deployment is not available for SharePoint 2016 Feature Pack 2 since it only supports SPFX 1.1, and this deployment option was released in version 1.4 If you are utilizing a SPFX webpart older than 1.4 you can upgrade with instructions via the CLI for Microsoft 365

特定于解决方案的要求Solution-specific requirements

使用此选项时,将忽略 SharePoint 框架解决方案中的所有功能框架定义。如果解决方案包含功能框架定义,例如创建自定义列表的定义,则不应使用此特定于解决方案的选项。When this option is used, any feature framework definitions in the SharePoint Framework solution are ignored. If the solution contains feature framework definitions, for example, for creating a custom list, you should not use this solution-specific option.

有关详细信息,请参阅使用解决方案包预配 SharePoint 资产For more information, see Provision SharePoint assets with your solution package.

备注

配置为在租户内自动进行部署的解决方案在站点级别的加载项应用功能中不可见。Solutions that are configured to be automatically deployed across tenants are not visible in the add-an-app capability at the site level.

将解决方案配置为在租户内可用Configure solution to be available across the tenant

SharePoint 框架 Yeoman 模板将询问与此选项相关的具体问题。The SharePoint Framework Yeoman template asks a specific question related to this option. 此问题将直接影响 package-solution.json 文件中的 skipFeatureDeployment 属性。This question impacts directly on the skipFeatureDeployment attribute in the package-solution.json file.

关于部署租户选项的 Yeoman 问题


在下面的示例配置中,skipFeatureDeployment 设置为 true,指明可以在整个租户内集中部署解决方案。In following example configuration, skipFeatureDeployment is set to true, which indicates that the solution can be centrally deployed across the tenant.

{
  "solution": {
    "name": "tenant-deploy-client-side-solution",
    "id": "dd4feca4-6f7e-47f1-a0e2-97de8890e3fa",
    "version": "1.0.0.0",
    "skipFeatureDeployment": true,
    "features": [
      {
        "title": "Application Extension - Deployment of custom action.",
        "description": "Deploys a custom action with ClientSideComponentId association",
        "id": "54f0dc0e-c190-439d-933b-2dd2809ed3c3",
        "version": "1.0.0.0",
        "assets": {
          "elementManifests": [
            "elements.xml",
            "ClientSideInstance.xml"
          ]
        }
      }
    ]
  },
  "paths": {
    "zippedPackage": "solution/tenant-deploy-true.sppkg"
  }
}

批准通过租户范围内部署将应用部署到应用程序目录Approving tenant-wide deployment in app catalog

如果将 skipFeatureDeployment 属性设置为 true 的解决方案已部署到租户应用程序目录,管理员可以将解决方案配置为在整个租户内集中部署。When the solution with the skipFeatureDeployment attribute set to true is deployed to the tenant app catalog, the administrator is given an option to configure the solution to be deployed centrally across the tenant.

默认情况下,“让此解决方案可供组织中的所有网站使用”**** 复选框处于取消选中状态。By default, the Make this solution available to all sites in the organization check box is not selected. 如果管理员选中此复选框,解决方案中的组件将在租户内自动可见和可用。If the check box is selected by the administrator, components in the solutions are automatically visible and available across the tenant.

将解决方案部署到应用程序目录时,将显示“使此解决方案在组织的所有站点中可用”设置

请注意,由于仅在使用功能框架时,解决方案和网站专用升级操作才可用,因此没有适用于集中部署的解决方案的特定升级选项。Notice that because the solution and site-specific upgrade actions are only available when you use the feature framework, there's no specific upgrade option for the centrally deployed solutions. 若要更新这些解决方案,可以更新 CDN 中的解决方案专用资产,并更新和部署应用程序目录中的包。These solutions can be updated by updating the solution-specific assets in the CDN and by updating and deploying the package in the app catalog. 这会自动将整个租户内的所有现有组件实例更新为,使用最新组件资产(如 JavaScript 文件和更新后的 CSS 文件)。This automatically updates all existing component instances across the tenant to use the latest component assets, such as JavaScript files and updated CSS files.

警告

对于包含站点扩展的解决方案包,只有在最初激活站点扩展时才需要选中“使此解决方案在组织的所有站点中可用”**** 复选框。For solution packages containing site extension(s), selecting the Make this solution available to all sites in the organization check box is only required to activate the site extension(s) initially. 更新现有解决方案包时,如果在部署过程中选中此复选框,可能会导致在“租户范围扩展”**** 列表中创建重复项。When updating existing solution packages, selecting the check box during deployment may create duplicate entries in the Tenant Wide Extension list.

SharePoint 网站上的客户端 Web 部件可见性Client-side web part visibility on SharePoint sites

在经典和新式页面的 Web 部件选取器中,集中部署的解决方案中包含的 Web 部件均会立即显示。Web parts included in solutions that have been centrally deployed are immediately visible in the web part picker in both classic and modern pages.

包含扩展的 skipFeatureDeployment 设置的影响Impact of skipFeatureDeployment setting with Extensions

SharePoint 框架扩展将立即在 SharePoint 网站中可用。SharePoint Framework Extensions are immediately available to be used on SharePoint sites. 这意味着它们可与特定 SharePoint 元素(例如,字段用户自定义操作)中的 ClientSideComponentId 属性相关联。This means that they can be associated with ClientSideComponentId properties in the specific SharePoint elements, such as fields and user custom actions.

另外,如果管理员在部署过程中选中“使此解决方案在组织的所有站点中可用”**** 复选框,解决方案包中的自动化设置可能会在应用程序目录上的“租户范围扩展”**** 列表中创建项。Additionally, if an administrator selects the Make this solution available to all sites in the organization checkbox during deployment, automations in the solution package may create entries in the Tenant Wide Extensions list on the app catalog. 此列表中的条目管理站点扩展的租户范围激活。Entries in this list manage tenant-wide activation of site extensions. package-solution.json 中引用的 ClientSideInstance.xml 文件对自动化设置进行了说明。The automations are described by the ClientSideInstance.xml file as referenced in package-solution.json.

有关详细信息,请参阅 SharePoint 框架扩展的租户范围部署For more information, see Tenant Wide Deployment of SharePoint Framework Extensions.

另请参阅See also