Edit

Create apps with PowerShell

Applies to: Owning tenant administrator — SharePoint Embedded admin / Global admin

Use SharePoint PowerShell to create SharePoint Embedded container types for apps. Each container type is associated with one Microsoft Entra application.

Before you begin

Make sure you have:

  • The SharePoint Embedded Administrator or Global Administrator role.
  • The latest SharePoint Online Management Shell.
  • The Microsoft Entra application ID that owns the container type.
  • For standard billing setup, owner or contributor permissions on the Azure subscription.

Important

Choose the billing method when you create the container type. You can't change the billing method after creation.

Create a standard billed app

Use standard billing when the organization that owns the app pays for SharePoint Embedded usage.

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

Set up billing for the standard container type by assigning an Azure subscription, resource group, and region.

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

Create a pass-through billed app

Use pass-through billing, also known as direct-to-customer billing, when the consuming tenant pays for SharePoint Embedded usage.

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

For pass-through billing, the consuming tenant administrator must set up Microsoft 365 pay-as-you-go services before users can access the app. For more information, see Set up billing in Microsoft 365 admin center.

Create a trial app

Use a trial app for evaluation and proof-of-concept work.

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

Trial apps are valid for 30 days.

View apps

List SharePoint Embedded apps created in the owning tenant.

Get-SPOContainerType
Get-SPOContainerType -ContainerTypeId <ContainerTypeId>

Update app properties

Update supported container type properties.

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

Configure app behavior

Configure supported container type settings, such as discoverability and sharing restrictions.

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

View the current configuration.

Get-SPOContainerTypeConfiguration -ContainerTypeId <ContainerTypeId>

Next steps

Install the app in the tenant: Install a SharePoint Embedded app.