Azure / Azure/Connectors-NET-SDK
OneDrive connector: multiple routes missing or returning 502 NRE
- Dominant language
- C#
- Stars
- 3
- Forks
- 5
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 7
Description
## Summary
Multiple OneDrive for Business connector routes are broken or missing when called through the Connector Gateway runtime URL. The connection is authorized and `testconnection` returns 200, but many operations fail.
## Environment
- **Connection**: `onedriveforbusiness-test` on `aigateway-partners` Connector Gateway
- **Runtime URL**: `https://c90b64473f2e4ca0a677be9df3a4f828.03.common.logic-eastus.azure-apihub.net/apim/onedriveforbusiness/a47268f984c44d1ba7f4e8af813df565`
- **Connection status**: Connected (green), `testconnection` returns 200
## Issue 1: V2 routes return 400 "Route did not match"
The following swagger-documented routes are not recognized by the connector service:
| Route | Operation | Status | Error |
|-------|-----------|--------|-------|
| `/datasets/default/foldersV2/{folder}` | List files in folder | 400 | `Route did not match` |
| `/datasets/default/extractFolderV2?...` | Extract archive | 404 | Not found |
| `/datasets/default/CreateShareLinkByPathV2?...` | Share link by path | 404 | Not found |
These routes are present in the connector swagger used by the CodefulSdkGenerator. The `foldersV2` route is the **only paginated listing operation** for OneDrive, so pagination cannot be tested E2E.
## Issue 2: Root folder listing returns 502 NRE
| Route | Operation | Status | Error |
|-------|-----------|--------|-------|
| `/datasets/default/folders` | List root folder | 502 | `Object reference not set to an instance of an object` |
The route matches (400→502 transition confirms it), but the upstream call throws a NullReferenceException server-side. This is reproducible on both the production connection above and the dogfood connection (`0a8e3a9fa83240839c163637de5e83f0.08.common.logic-df.azure-apihub.net`).
## Issue 3: Additional missing routes
| Route | Operation | Status |
|-------|-----------|--------|
| `/datasets/default/findFile?query=...` | Find files by path | 404 |
| `/datasets/default/copyFile?...` | Copy file | 404 |
## Working routes (for comparison)
| Route | Operation | Status |
|-------|-----------|--------|
| `/testconnection` | Health check | 200 |
| `/datasets/default/GetFileByPath?path=/` | Get file metadata by path | 200 |
| `/datasets/default/folders/{id}/search?query=...&findMode=OneDriveSearch` | Search files in folder | 200 |
| `/datasets/default/files/{id}` | Get file metadata by ID | 400 (route matches, rejects fake ID) |
| `/datasets/default/files/{id}/content` | Get file content by ID | 400 (route matches, rejects fake ID) |
## Impact
- `ListFolderAsync` (`foldersV2/{folder}`) — the only paginated listing operation — **cannot be validated E2E**
- `ListRootFolderAsync` (`/folders`) — **server-side NRE makes this unusable**
- Multiple file management operations (`copyFile`, `findFile`, `extractFolderV2`, `CreateShareLinkByPathV2`) are unreachable
## Expected behavior
All swagger-documented routes should be available and functional when the connection status is "Connected".
## Reproduction
```powershell
$token = az account get-access-token --resource https://apihub.azure.com --query accessToken -o tsv
$base = "https://c90b64473f2e4ca0a677be9df3a4f828.03.common.logic-eastus.azure-apihub.net/apim/onedriveforbusiness/a47268f984c44d1ba7f4e8af813df565"
$h = @{ Authorization = "Bearer $token" }
# Works
Invoke-WebRequest "$base/testconnection" -Headers $h
Invoke-WebRequest "$base/datasets/default/GetFileByPath?path=%2F" -Headers $h
# Broken — 400 Route did not match
Invoke-WebRequest "$base/datasets/default/foldersV2/root" -Headers $h
# Broken — 502 NRE
Invoke-WebRequest "$base/datasets/default/folders" -Headers $h
```
Contributor guide
Assessment
This issue has not been assessed yet.