Bug Report
Description
az connector-namespace connection invoke crashes with a Python deserialization error when the upstream connector returns an array response body instead of a dict/object. This affects multiple connectors including OneDrive for Business and SharePoint Online.
Repro Steps
- Create a Connector Namespace with a OneDrive for Business or SharePoint Online connection
- Authorize the connection (OAuth consent)
- Invoke an API that returns an array:
# OneDrive folder listing
az connector-namespace connection invoke \
-g <resource-group> --namespace <namespace> \
--connection-name <connection-name> \
--request "{method:GET,path:'/datasets/default/folders'}" \
-o json
# SharePoint site/library listing
az connector-namespace connection invoke \
-g <resource-group> --namespace <namespace> \
--connection-name <connection-name> \
--request "{method:GET,path:'/datasets'}" \
-o json
Expected Behavior
The command should return the connector response wrapped in the standard envelope:
{
"response": {
"statusCode": 200,
"body": [ { "Id": "...", "Name": "FolderName", "IsFolder": true, ... }, ... ]
}
}
Actual Behavior
The CLI extension crashes with:
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: Expect <class 'dict'>, got [{'Id': '...', 'Name': '1ESBot', ...}, ...]
The data IS returned (visible in the error message), but the CLI's Python deserialization layer rejects it because it expects a dict and receives a list.
Affected Connectors
- onedriveforbusiness — folder listing (
/datasets/default/folders)
- sharepointonline — site/library listing (
/datasets)
- Likely any connector operation that returns a JSON array rather than a JSON object
Impact
- Prevents using
connection invoke for interactive browsing (folder picker, site picker) in postdeploy scripts.
- Any connector operation that returns an array body will hit this same issue.
Environment
- Azure CLI: 2.75.0
- connector-namespace extension: installed via
irm https://aka.ms/connector-namespace-cli-install-ps | iex
- OS: Windows 11
Workaround
Currently falling back to pre-setting resource IDs via azd env set (e.g. ONEDRIVE_FOLDER_ID, SHAREPOINT_SITE_URL).
Bug Report
Description
az connector-namespace connection invokecrashes with a Python deserialization error when the upstream connector returns an array response body instead of a dict/object. This affects multiple connectors including OneDrive for Business and SharePoint Online.Repro Steps
Expected Behavior
The command should return the connector response wrapped in the standard envelope:
{ "response": { "statusCode": 200, "body": [ { "Id": "...", "Name": "FolderName", "IsFolder": true, ... }, ... ] } }Actual Behavior
The CLI extension crashes with:
The data IS returned (visible in the error message), but the CLI's Python deserialization layer rejects it because it expects a
dictand receives alist.Affected Connectors
/datasets/default/folders)/datasets)Impact
connection invokefor interactive browsing (folder picker, site picker) in postdeploy scripts.Environment
irm https://aka.ms/connector-namespace-cli-install-ps | iexWorkaround
Currently falling back to pre-setting resource IDs via
azd env set(e.g.ONEDRIVE_FOLDER_ID,SHAREPOINT_SITE_URL).