Guys,
I created a custom http connector to a python (REST in its most simplified form) web application, that accesses a few Sharepoint sites. It was working fine for about 3 years until recently. The application was broken due to new MFA requirement, and I was no longer able to make read and update requests to Sharepoint from python, specifically from code utilizing the office365 REST library.
Admittedly, I for sure am no MS Azure expert. I really wasn't exactly sure what I need to do to fix my issue, but I knew that I needed to make changes in MS Azure.
This post is for people like me that don't know anything about MS Azure, just want to get things working again, and are confused about the differences inherent in MS Azure ACS, MS Azure AD or Entrata.
I researched for a while and tried some things from the MS Azure forum, and was not able to get anything to work.
Each failed attempt got me a little closer to what I needed to do though. I found out that I originally configured my application access to Sharepoint through MS Azure ACS. And I found out that MS Azure ACS has been retired, and that MFA was being pushed as the application access standard. That standard in relation to MS TEAMS and Sharepoint was now being handled by MS Azure AD or even more recently MS Entrata.
According to MS:
"MS Azure ACS has been retired, and Azure AD is the recommended replacement for managing authentication and authorization in Azure-based applications."
I'll go over the old way that I used initially to setup application access, and then go into the most helpful resources I found that got it fixed. BTW, all of this stuff regarding MS Azure AD assumes you or someone you know has admin access to MS Azure AD.
OLD WAY TO SET PERMISSIONS – MS AZURE ACS
Within MS Azure ACS there were 2-3 older MS Azure ACS admin pages that were required to be filled out to make the external application using username-password be able to access a Sharepoint site's files and lists (keep in mind contoso is just the MS test domain, you would replace it with your sharepoint domain, if you were to actually do this);
https://contoso.sharepoint.com/_layouts/15/appregnew.aspx
https://contoso-admin.sharepoint.com/_layouts/15/appinv.aspx
For more detailed information on these urls used with MZ Azure ACS, which again has been retired, please go to;
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
In this way, you would have created access for the application to a MS Azure or in my case a Sharepoint recource, and the way it was done here was with UID and PWD, which of course is not ideal, but anyway...
Even though this is no longer the way we do this, it is worth mentioning, because when you search for documents and sites to help you setup application access to a Sharepoint resource from an external application, sometimes people mix up the old MS Azure ACS way and the new MS Azure AD (Entrata) way, and if you aren't careful, you may have a very difficult time getting it to work.
NEW WAY TO SET PERMISSIONS – MS AZURE AD (ENTRATA)
This article below is a good starting point, and as you will see is important in how to access specifically selected Sharepoint sites, thank you very much to the Author of this article, RoboEase, its super detailed and excellent;
This MS article has the script to create a self-signed certificate, thanks go to Microsoft for including the script to create the self-signed cert;
Granting access via Azure AD App-Only | Microsoft Learn
For even more information please watch the following youtube video, Thank You @GracielaPowerGI (twitter), this is excellent and she makes it very easy;
SharePoint API set up via Azure AD App-Only & Connection from Power Automate
Mostly Everything you need to know is in the above video and linked articles, but here is a short synopsis of setting up access with MA Azure AD to a Sharepoint resource from an external python application using a certificate for Authentication;
As a last thing, Ideally I want to only access 1 list and 1 folder in each site with read and write, so If I could restrict my access within those sites to only those resources, that would be even better. But I am not there yet. If anyone has any clue how to do that, please let me know!
As always if you see anything I forgot, or is wrong let me know and I will fix it.
Cheers,
Scoobert
Ok, today is another day! Now its broken again. Yesterday my test code worked perfectly, everything was great. Now today, getting this, I added the "zzz" for obfuscation:
"ValueError: {'error': 'invalid_resource', 'error_description': 'AADSTS500011: The resource principal named https://zzz.sharepoint.com/zzz/zzz was not found in the tenant named zzzzz.. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: blah Correlation ID: blah Timestamp:
2024-07-21 00:30:39Z', 'error_codes': [500011], 'timestamp': '2024-07-21 00:30:39Z', 'trace_id': 'blah', 'correlation_id': 'blah', 'error_uri': 'https://login.microsoftonline.com/error?code=500011'}"
Again, it worked great yesterday. I did remove the Sites.FullControl.All permission and left only Sites.Selected, and again it was fine.
I just put back the Sites.FullControl.All permission and still it failed, but maybe it needs time to propogate?
If anyone has any clue why this happened and what I can do, please let me know, this is driving me crazy!
Again, today is another day. Its working again. I'm not sure what is going on with this stuff. I'll update again if something changes, weird.
Dear Community Members, As you may have read, the Power Platform communities are transitioning to a new platform and to access will be set to READ-ONLY mode during the transition. Key DatesTo ensure current learners have adequate support in the final week of the cohort, the Power Up Program Community will transition to READ-ONLY mode starting July 22nd, the platform will transition to READ-ONLY mode until July 28th. Power Apps, Power Automate, and Power Pages communities will be read-only July 16-22, 2024.During this period, members will not be able to start new threads or Kudo, Comment, or Reply to any posts, but will be able to search and review past threads or solutions. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. Learners will be able to sign in to the new Power Up Program community experience, starting July 29th. If you registered for community using your learnwithpowerup account, you will not receive an email, but should be able to sign in successfully if you are signed in to My hub. If you need help with your community account, please submit a request at aka.ms/PPCommSupport We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!
Since its inception in 2022, the Power Up Program has evolved based on feedback from learners and Microsoft Partners and customers. Today's Power Up learners can expect to learn the fundamentals of Microsoft Power Platform in the accelerated seven-week, video-based Power Up Maker course. Hear from Principal Program Manager, Dimpi Gandhi to discover the latest enhancements and meet the Microsoft MVPs, Rory Neary and Charlie Phipps, who partnered with the Microsoft Power Up Program to create the Power Up Maker course to guide learners to use the Microsoft Power Platform to develop custom applications, build dazzling report dashboards, or create efficiencies through automation.
The Power Up Program is a free upskilling program where nontechnical people can learn the fundamentals of Microsoft Power Platform. The Power Up Maker course is a seven-week self-paced virtual learning plan that include video-based objectives featuring Power Apps, Power BI and Power Automate. As a member of the Power Up Community, you can grow your skills and build connections. You can post questions to get help with the curriculum and hands-on exercises from experts and peers in the product boards. Check out the Community Information & Feedback board to find help or provide feedback with the community experience, and please take time to post in the Social board to tell us more about yourself. If you're new to the Power Up Program and looking for information to register. You can sign up at PowerUp.Microsoft.com.