Unable to create a Sharepoint Connection in Azure AI Foundry

Henry Okwuenu 35 Reputation points
2025-09-12T07:14:17.3633333+00:00

Hi All,

I am unable to connect my sharepoint site successfully using the sharepoint connection tool in Azure Ai Foundry. I have tried everything but still cannot caonnect to my sharepoint site.

The documentation says the url should be in the format "https://microsoft.sharepoint.com/teams/<site_name>/Shared%20documents/<folder_name>" however my site url config is in the format https://microsoft.sharepoint.com/site/<site_name>/Shared%20documents/<folder_name>

My url uses /site rather than /teams. Does this make any difference? The Error i get is: Failed to create connection ValidationError: Invalid credential.

I am a global admin, have the Azure AI User/Admin role on my Azure Subscription, and also have the AI Administrator Role in Entra.

Note: I created a new sharepoint site with a simple folder structure and have owner and member roles in the site but still no luck.

I have gone through the documentation at https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/sharepoint and https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/sharepoint-samples?pivots=python with no luck.

Will appreciate if anyone can help.

Thank you

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Alex Burlachenko 18,570 Reputation points Volunteer Moderator
    2025-09-12T08:20:57.66+00:00

    hi Henry, thanks for posting this. that error can be so annoying, especially when u are sure u have all the right permissions. let's break this down.

    first, that url difference is huge. yes, it absolutely matters. the tool is specifically looking for a path that starts with /teams/ for those modern team sites. if your site uses /sites/ in the path, it is likely a classic communication site or a different template. the connection tool might not recognize it properly, which could be causing the credential error because it can't find the right endpoint to talk to.

    for your microsoft azure ai foundry solution, u need to make sure u are using a modern team site. its url should look exactly like this https://microsoft.sharepoint.com/teams/your-site-name. try creating a new site from scratch and choose the 'team site' template this time. then, use that new url in the connection tool. this often fixes the issue straight away.

    also, check this. the credential error might not be about your global admin role. the connection needs to authenticate as an application. did u create an entra id app registration and grant it the right api permissions? u need to add sites.selected application permissions for sharepoint. the docs here explain that part https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/sharepoint. its a step everyone misses.

    make sure u grant admin consent for those permissions in the entra portal after u add them. then, use the application's client id and secret when u set up the connection in ai foundry. worth looking into.

    now for some general advice that might help in other tools too. always test your permissions in a simpler way first. try to access the sharepoint site using graph explorer with your credentials. just sign in at https://developer.microsoft.com/graph/graph-explorer and try a call like https://graph.microsoft.com/v1.0/sites/root. if that fails, u know the issue is broader than just ai foundry.

    aha, and one more thing. check the certificate of your sharepoint site. sometimes security policies or custom certificates can interrupt the handshake. as well check this, its a long shot but it has fixed weird issues for me before.

    if u are still stuck after all this, it might be time to open a support ticket. they can look at the backend logs and see exactly why the validation is failing. u have done more than enough troubleshooting already.

    hope this points u in the right direction. dont get discouraged. this stuff is tricky, but u will get it. let me know how it goes

    Best regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.