Category: AI (page 1 of 1)

Return the True URL for a Document in SharePoint Online Indexer for Azure Search

I am going to keep today’s post short and sweet, covering a quick change I needed to make to my SharePoint Online Indexer (still in preview but we’re using it for our custom chat bots) to make the index of a SharePoint library return the true URL of the source document so that we can feed that back to users so they can validate the chat bot answers.

It took me longer than I would like to admit to figure out how to do this, even though the metadata item is listed in the one and only Microsoft document for this tool, because I was wanting to return the URL and the documentation only mentioned URI and didn’t explain what they meant by that and gave no examples of it being used.

This index is specifically used for custom chat bots created through Azure AI Foundry, and not for those created with other AI or cognitive services within Azure. I saw a lot of documentation and forum posts about those versions of indexers, but didn’t see anything covering this topic specifically which is why I wanted to write this post.

What’s in this post

Adding SharePoint document URL to index results

For creating my Azure Search data sources, indexes, and indexers, I have used Postman to run the API calls needed to hit the SharePoint Online (SPO) indexer service, since that is the only way to create this type of indexer (can’t use the Azure portal wizard).

It is very simple to return the document URL in your index, you only need to add this line to your index, and then rename it/map it in the indexer definition if you want. I didn’t not want to rename it, so I only changed the index definition.

{ "name": "metadata_spo_item_weburi", "type": "Edm.String", "key": false, "searchable": false, "filterable": false, "sortable": false, "facetable": false },

Once you add that to your index definition, make sure to send the API request through again, then reset and run the indexer related to the index. At that point, you should be able to query your index through the console and see that URL included in the results of the index.

Screenshot of an Azure AI Search Index resource test query demonstrating what the full URL of a SharePoint document looks like in the index

Summary

If you are using the SharePoint Online Indexer for Azure AI Search (with Azure AI Foundry) and you would like to return the full URL of a source document for a chat bot response, you can do so by adding the “metadata_spo_item_weburi” metadata field to your index definition.

Related Posts

Recent Security Issues with AI

Are you and your company keeping track of the security of the artificial intelligence (AI) tools your employees are using? Are you aware that AI is not magically more secure than other software tools, and may in fact be more prone to attack due to its newness and speedy development? If not, you need to start watching the news for cyber attacks that are related to AI. These aren’t even exclusive to all the new AI startups making moves in the industry; even tech giants like Google have been found to have major flaws in their AI tools.

I am not a cybersecurity expert, so I won’t go into detail attempting to cover the vulnerabilities that have been found, but I highly encourage you to read through these two articles I found recently that covered the exploits.

The first is about three major vulnerabilities discovered in Google’s Gemini AI assistant. Three different issues spread across different facets of the tool. I expect better of Google.

https://www.darkreading.com/vulnerabilities-threats/trifecta-google-gemini-flaws-ai-attack-vehicle

The second article is about a much more niche AI tool, a “Model Context Protocol” (MCP) server package that had the most ridiculously simple exploit.

https://www.darkreading.com/application-security/malicious-mcp-server-exfiltrates-secrets-bcc

Standard cybersecurity processes are more important now than ever. Never trust the software or code you are using. Don’t put your most sensitive company data into tools managed by people outside of your company that you don’t trust 100%. Due diligence is always useful. AI is proliferating more than ever and it is guaranteed a lot of the tools won’t be following security best-practices. Protect yourself as much as you can using common sense, and keep on top of recently announced exploits using trusted news sources.