Azure / Azure/azure-cli

az rest cli commands fails in azure ubuntu agents

Open
#29,691 3 comments 0 reactions 1 assignee Claimed by @jiasli View on GitHub
Auto-Assign Auto-Resolve bug customer-reported Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

az rest cli commands fails in azure ubuntu agents.
Agent-Pool : Azure Pipeline
Agent specification : ubuntu-latest
Azure-cli version : 2.62.0

### Related command

az rest --method patch --uri $url --headers $headers --body

uri - https://graph.microsoft.com/v1.0/applications/xxxxxxxx-xxxxxx
headers - '{"Content-Type":"application/json"}' | ConvertTo-Json
body(payload) -
{
"api": {
"oauth2PermissionScopes": [
{
"adminConsentDisplayName": "Access on behalf of a user",
"userConsentDisplayName": "Access on behalf of a user",
"adminConsentDescription": "Access on behalf of a user",
"userConsentDescription": "Access on behalf of a user",
"type": "User",
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"isEnabled": true,
"value": "access_as_a_user"
}
]
}
}

### Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
raise ex
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/util/custom.py", line 24, in rest_call
r = send_raw_request(cmd.cli_ctx, method, url, headers, uri_parameters, body,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/util.py", line 877, in send_raw_request
result.update(temp)
File "", line 954, in update
ValueError: not enough values to unpack (expected 2, got 1)

### Issue script & Debug output

NA

### Expected behavior

az rest cli commands should be executed on ubuntu agent

### Environment Summary

azure-cli 2.62.0 *
core 2.62.0 *
telemetry 1.1.0
Extensions:
azure-devops 1.0.1
Dependencies:
msal 1.28.1
azure-mgmt-resource 23.1.1
Python location '/opt/az/bin/python3'

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.