Problem: Site Assets Library missing in SharePoint Online.
How to Create Site Assets Library in SharePoint Online?
The site assets library usually stores images, logos, audio-video, CSS, and JS files, and it gets created automatically when you start customizing your site. E.g., changing the site logo, uploading an image for the Hero web part, etc., will create the site assets library in SharePoint Online! In other words, Until you do these sorts of customization, you won’t find the “Site Assets” library in SharePoint Online sites, such as sites created with communication site templates.
In my case, We wanted to pre-create the site assets library as we provisioned a bunch of sites from a CSV file. Here are the solutions to create a site assets library:
Option 1: Activate “Video and Rich Media” Feature
Activate the video and rich media feature to create the site assets library in SharePoint Online:
- Go to your Site collection >> Click on “Site Information” >> Site Settings
- Click on “Site Collection Features” under Manage Site collection features
- Click on the “Activate” button next to the “Video and Rich media” feature.
This brings the Site Assets library and Site Pages to SharePoint Online site. Other features can bring the site assets library like: “Wiki Page Home Page” site feature, SharePoint Server Publishing Infrastructure, etc. You can use PowerShell to activate any of these features: Activate a feature for all SharePoint Online sites using PowerShell.
Option 2: Ensure Site Assets Library using PnP PowerShell
Instead of activating any of the features discussed above, You can programmatically ensure the site assets library using PowerShell.
#Parameters $SiteURL = "https://crescent.sharepoint.com/sites/portal" #Connect to Tenant Admin Site Connect-PnPOnline -url $SiteURL -Interactive #Ensure Site Assets $Web = Get-PnPWeb $Web.Lists.EnsureSiteAssetsLibrary() Invoke-PnPQuery
This script creates the site assets library in SharePoint Online if not created already.