halliba / az-pipelines-2-sharepoint

Azure DevOps extension - upload build files to SharePoint Online
GNU General Public License v3.0
9 stars 4 forks source link

[Help needed] Error: ##[error]Could not find drive and ##[error]Invalid driveId #5

Closed karolwojcik-eaton closed 1 year ago

karolwojcik-eaton commented 2 years ago

I have been receiving the following error regardless in which format I place the SharePoint url in: image

Also is the path format for the target folder in the "Target Folder" parameter like so: image If the folder I want to publish to is in the Documents (no subfolders) of the site I wish to publish to?

Sorry for raising so many issues - appreciate the help!

halliba commented 2 years ago

Hi,

If possible, can you try entering the following query in Microsoft Graph Explorer (https://developer.microsoft.com/en-us/graph/graph-explorer): https://graph.microsoft.com/v1.0/sites/<tenant>.sharepoint.com:/<sites or teams>/<site-name> e.g.: https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/mysite (The : is not a typo.)

Do you get a result?

If so, copy the id of the site and check this query: https://graph.microsoft.com/v1.0/sites/<site-id>/drives

Find the library you want to use and compare the webUrl with the url you used in the task. And now that you found your driveId, you can try to use that one in the task to check if it's a general problem with the site/drive.

Edit: The Target Folder is correct.

Thank you :)

breakpoint7 commented 2 years ago

*Updated (solution) - after chasing what I thought was a problem with the drive info and verifying those work via Graph Explorer -- the only thing left that it could be was the app registration info. I found I had misconfigured a GUID in my app registration info. I was expecting an exception to report a permissions error, but the graph client can bubble up into the drive operation which can report an invalid driveId, when in fact, the graph call is just failing. Make sure you double check your app registration.

halliba commented 2 years ago

Hi @breakpoint7, I already updated the code to show more information (and the correct error message from the drive api) on a drive-related failure. Will be included in the next release. Thank you for updating your question!

mdzgua commented 1 year ago

Hi @halliba i have the same errors as @karoleaton, maybe exist one more solution ? :)

tenant ID, client ID, secret, api permissions are right as in your manual... I checked all querries in MS Graph from your comment [on Aug 24] and the webUrl is correct, when using driveid in the errors are same...

Please help!

halliba commented 1 year ago

Hi, I've added some new error handling in v0.3.3. If you still have these issues, please try again.

mdzgua commented 1 year ago

Its ok now, thank you! :)