0

I developed an Azure Function that is copying files from Sharepoint to Teams via Graph API.

In my development Tenant, the Azure Function works fine but when I deploy it in my customer tenant, the file copy fails.

In Azure AD, I registered an application with Sites.ReadWrite.All. The AppID/Secrets are used to authenticating the API call.

My call is :

POST /drives/b!LbotXZhkxke94OcM0YXrwjR86upNLJdLhSZ_OgDp-T-mtydXTv3sT5A00CrdeZV3/items/01XH5SRTDWNAGSEI66J5GZZXQ6J3NX5KBY/copy
{
  "parentReference": {
    "driveId": "b!mYnVUTiLdES_vJKviIRhfBS6yvSHBD5Bkm3MUTeSBz0DLlyWwF6ORIRel-MFHkAv",
    "id": "01B7MS37LA35AKR6UYIBDJW3QA5DFVCCZJ"
  }
}

The response status is accepted but the files are not copied.

The location response header value is correct, but when I browse to the location URL, I have the message "General exception while processing".

The source files exist and the destination drive exists. If I make this API call in the Graph API Explorer, the files are copied.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • How are you obtaining your token? – Marc LaFleur May 03 '19 at 20:08
  • AuthenticationContext context = new AuthenticationContext(ConfigurationHelper.MicrosoftOnlineAuthorityBaseUri, false); AuthenticationResult authenticationResult = await context.AcquireTokenAsync(ConfigurationHelper.MicrosoftGraphBaseUri, ClientCredential); return authenticationResult.AccessToken; Where : - ClientCredential uses AppID and AppSecrets - MicrosoftOnlineAuthorityBaseUri = https://login.microsoftonline.com/{TenantId} - MicrosoftGraphBaseUri = https://graph.microsoft.com/ – Hervé D. May 05 '19 at 10:15

0 Answers0