Unable to Deploy SPFx Agent to a Single SharePoint Site (Works Only with Tenant-Wide Deployment)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- powershell, typescript
- Domain
- authentication, devops, web-dev
Research direction
Compare the tenant-wide and single-site .sppkg deployment settings, including skipFeatureDeployment and ClientSideInstance.xml, and review the PnP PowerShell custom action configuration. Reproduce both deployment paths and trace where token acquisition differs; done means the agent authenticates on the target site without appearing on other sites.
Written by the indexing model from the issue text.
Description
I have developed an SPFx Application Customizer that hosts a Copilot/Agent sidebar in SharePoint.
Scenario 1: Tenant-Wide Deployment (Works)
When I upload the .sppkg package and select "Enable this app and add it to all sites":
The extension is automatically added to Tenant-Wide Extensions.
I configure the following properties:
Client App ID
Tenant ID
Redirect URL
The bot icon appears in SharePoint.
The agent connects successfully and works as expected.
However, because the deployment is tenant-wide, the bot icon also appears on all other SharePoint sites, which is not my requirement.
Scenario 2: Single Site Deployment (Fails)
When I upload the same .sppkg package and select "Only enable this app":
No entry is created in Tenant-Wide Extensions.
The app is available on the target SharePoint site.
The agent attempts to connect but fails with the error:
Plain Text
Unable to Acquire Token
Show more lines
Troubleshooting Attempted
- Set skipFeatureDeployment to false
JSON
{
"skipFeatureDeployment": false
}
Result: No change.
- Register the Application Customizer manually using PnP PowerShell
PowerShell
Add-PnPCustomAction `
-ClientSideComponentId 4c6e29f2-7eee-4f9f-bbd2-20c8859d0ba2 `
-ClientSideComponentProperties '{"appClientId":"...","tenantId":"...","directConnectUrl":"..."}' `
-Location ClientSideExtension.ApplicationCustomizer `
-Name "SidebarAgent" `
-Title "SidebarAgent" `
-Scope Web
Show more lines
Result: The agent still fails with "Unable to Acquire Token".
even MS support team suggest to delete or remove the ClientSideInstance.xml file and build the solution package. i Did same but result is same
Questions
Why does token acquisition work when the extension is deployed tenant-wide but fail when deployed to a single site?
Is there any additional configuration required for site-scoped deployment?
What is the recommended approach to deploy an SPFx Application Customizer/Agent to only one SharePoint site?
Has anyone successfully implemented a single-site deployment for a similar SPFx-based agent?
Expected Behavior
The agent should be available and functional only on the target SharePoint site, without appearing on other sites across the tenant.
- Dominant language
- TypeScript
- Stars
- 797
- Forks
- 491
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/CopilotStudioSamples
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Issue: SharePoint SSO ComponentMay be free again @adilei claimed this 31 days ago, and no pull request is open. OpenSharePointSSOComponent
microsoft/CopilotStudioSamples#537 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/CopilotStudioSamples#532 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in microsoft/CopilotStudioSamples
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aiko-chan-ai/DiscordBotClient#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vercel/ai-elements#507 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 Half a day Newbie friendliness 84/100
anaclumos/qa-interns#148 · 1 comment ·
Maintainers usually reply within 1 day