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