Once upon a time, the SharePoint property bag was the hidden attic of your site — a place to stash all sorts of metadata goodies like project numbers, department IDs, and secret pizza orders for Friday lunch. You knew it was there, but you needed a map (aka PowerShell scripts) to access it.
Fast forward to 2025, and Microsoft’s Copilot AI is shaking things up! Now, instead of rummaging through documentation and crafting PowerShell incantations, you can simply ask your Copilot agent to update the property bag for you.
Sounds magical? It is. Let’s unpack how Copilot can make your property bag tasks feel less like drudgery and more like wizardry.
The Property Bag: Still Relevant in a Modern SharePoint World
The property bag is SharePoint’s under-the-hood key-value store for storing custom metadata at the site, list, or library level. It’s been around for ages, but it remains a powerful tool for admins and developers looking to inject extra context into their sites.But here’s the catch: there’s no GUI for managing property bags. You’re stuck with PowerShell commands like:
Set-PnPPropertyBagValue -Key "ProjectNumber" -Value "12345"
Sure, it works. But it’s not exactly fun, especially if you’re more of a clicker than a coder.Wouldn’t it be great if you could just talk to SharePoint and have it handle the property bag updates for you?
Adding a New Property Bag Value 💬 You: “Hey Copilot, add a property bag value to the Sales site. Set the key to ProjectNumber and the value to 12345 .”🤖 Copilot: “Got it! Adding ProjectNumber with a value of 12345 to the Sales site’s property bag.” | Retrieving Property Bag Values 💬 You: “Copilot, can you show me all the property bag values for the Marketing site?” 🤖 Copilot: “Sure! Here’s what I found in the Marketing site’s property bag: Department: Marketing BudgetCode: 2024-Marketing-01 Would you like to update or delete any of these values?” |
That’s it. No scripts. No errors. Just results.
As we explored in our previous post, it’s totally possible to fire off requests to a PowerShell script using Copilot and the Azure Queue component from the Power Platform toolbox. But here’s the twist — now it’s time to pull some answers back! Let’s talk about how to retrieve that information and close the loop.
The Problem: NoScript + Property Bag = Access Denied
But first , we need to deal with the NoScript feature of SharePoint . NoScript is a security feature that prevents users from running custom scripts on SharePoint sites. It’s a smart move to keep malicious code at bay, but it has an unintended side effect: it also blocks property bag updates. Trying to run a property bag update on a NoScript-enabled site? You’ll get this frustrating error:
Set-PnPPropertyBagValue -Key "MyKey" -Value "MyValue"
# Returns error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
To get around this, admins had to temporarily disable NoScript, update the property bag, then re-enable NoScript. It worked, but it was messy. Good news! Microsoft now offers a tenant-wide fix that allows you to update property bags without touching the NoScript setting. Say hello to the snappily named:
Set-SPOTenant -AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled $true
Now that we’ve given our tenant a good spring cleaning, it’s time to head back to our Azure Function (remember Part 1?) and teach it some manners — specifically, how to handle its output.
Update Your Function Code (Time to Get Chatty!)
Let’s enhance our Azure Function’s conversational skills by enabling it to respond to our Agent ! We’ll configure it to place a message into an Azure Queue, ready for our Copilot agent to retrieve. Here’s how to achieve this:
- In the Azure portal, search for and select the Function App you created in Part 1.
- Go to Integration and hit that + Add Output button. Now your function talk back to an output queue.

- Next, select the Azure Queue Storage binding type. We want to put a message into a queue. Here’s what to fill in:

- And sprinkle a little PowerShell magic into your run.ps1 script to handle the output binding!
Push-OutputBinding -Name outputQueueItem -Value $outputvalue
Azure Queue Storage is a solid choice for simple message-based workflows, but it comes with some quirks that might make you go, “Wait… what?” Here’s a rundown of the most annoying limitations and some clever ways to work around them.Think of Azure Queue Storage as someone with a very small inbox — it only accepts messages up to 64 KB in size (after encoding). So, forget about cramming a novel into a single queue message.
If your message is bursting at the seams, store the payload in Blob Storage and just send a link through the queue. Or, use Azure Service Bus for bigger messages (up to 1 MB).
In our case, we simply pass a varchar
that packs both the result of the property bag update (OK/NOK) and the ID of the currently running Copilot conversation — like a little message-in-a-bottle, floating through the system.

No, we have a function in Azure that gets triggered by a message pushed to the queue. It then runs a PowerShell script to retrieve information and pushes the result to an output queue, where our Copilot agent picks it up for further processing. Tada !
Update our Copilot Agent !

Here comes the frustrating part: as of today, there is no way to “delay” the Copilot flow to wait for the exit message to be added to the output queue, unlike Power Automate, which offers this capability. What we can do, however, is create a loop that keeps checking until the queue is updated with OK and our current System.Conversation.Id
.

(If("OK"in Topic.Var.MessageText,true,false)=false) And (If(System.Conversation.Id in Topic.Var.MessageText,true,false)=false)
By now, you know the drill — and you can unleash those retroaction loops for all sorts of automation mischief, even for tasks that have nothing to do with a property bag. Go ahead, get creative! Who said automation can’t be fun?
Last but not least !
The SharePoint property bag is a powerful, if underappreciated, feature. But let’s face it — it’s overdue for a modernization.Thanks to Copilot, managing property bags no longer feels like a task for the brave few who enjoy writing PowerShell scripts. It’s now accessible to everyone — from seasoned admins to the “I-don’t-touch-scripts” crowd.
And if we can convince Microsoft to throw in a Property Bag GUI on top of that? Well, let’s just say SharePoint admins everywhere would rejoice.