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. For E.g. Changing the site logo, upload 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. There are other features that 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 -UseWebLogin #Ensure Site Assets $Web = Get-PnPWeb $Web.Lists.EnsureSiteAssetsLibrary() Invoke-PnPQuery
This creates the site assets library SharePoint Online, if not created already.