Forum Discussion

CardinalNight's avatar
CardinalNight
Brass Contributor
Oct 02, 2024

SPFx Application Customizer not registering when using PowerShell JSON to register

I've been tasked to create a site script which will run when an SPO global admin creates an SPO Site collection:

$themeName = "ASCv12"
$site_script = @' 
 {
   "$schema": "schema.json",
     "actions": [
        {
            "verb": "setSiteExternalSharingCapability",
            "capability": "Disabled"
        },
        {
            "verb": "applyTheme",
            "themeName": "Blue Yonder"
        },           
        {
           "verb": "associateExtension",
           "title": "site-script-hide-client-side-solution",
           "location": "ClientSideExtension.ApplicationCustomizer",
           "clientSideComponentId": "34e874b4-48ed-4fa6-97b9-04a6054f2902",
           "scope": "Site"
        }
     ],
         "bindata": { }, 
    "version": 1
 }
'@@

I've read this documentation:

Site template JSON schema | Microsoft Learn which shows the exact syntax I'm using. I've tried using the clientSideComponentId from the:

  • package-solution.json
  • manifest.json
  • Root App catalog Product Id number (I've uploaded it to this app catalog.)

But when the site is created, the extension does not work. I've checked logging and nothing is triggering.

The SPFx extension is an Application Customizer which is vanilla. I've not customized it because I wanted to test it out first of all. But as mentioned, it's not triggering.

Can anyone advise? Has anyone encountered this before and did you resolve it?

No RepliesBe the first to reply

Resources