Hello @Krishnamohan Nadimpalli ,
Thanks for the question and using MS Q&A platform.
From the error message Please check if service url and credential is correct and your application has permission to the resource. Expected status code: 200, actual status code: Unauthorized
- Seems like you are having authentication issue to your SharePoint site.
Please make sure you follow the exact steps as described below:
Register SharePoint Application and Grant permission
- Register AAD Application (with user's personnel account) a) Open azure portal aad app registration page: https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps
b) New registration, enter your app name
c) Go toCertificates & secrets
, create new client secret, you can set the expire to 1Y/2Y/Never
- Grant sharepoint site permission to your registered App (need site owner permission) 1) How to find the site owner
a) Go to site home page( e.g.https://[your_site_url]/_layouts/15/appinv.aspx (replace the site URL)
), and click theX members
in the right corner
b) Check who is the owner
2)Open sharepoint site link: https://[Tenant-Name].sharepoint.com/sites/[Site-Name]/_layouts/15/appinv.aspx (replace tenant/site name) 3)Search the AppId you just registered in Step 1a and fill the empty fields and click "Create"
App Domain: localhost.com
Redirect URL: https://www.localhost.com
Permission Request XML:
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Read"/> </AppPermissionRequests>
4) Click "Trust It" for this app
Then create ADF pipeline with the flow discussed in the document: Copy file from SharePoint Online
Hope this info helps. Do let us know how it goes.
- Please don't forget to click on
or upvote
button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators