Skip to content

Unable to upload logo image to app registration #24696

@alexdrenea

Description

@alexdrenea

This is autogenerated. Please review and update as needed.

Describe the bug

Trying to upload the logo for an Azure app Registration, running into an encoding issue with az rest. (See below)

Command Name
az rest

Errors:

The command failed with an unexpected error. Here is the traceback:
'latin-1' codec can't encode character '\u2030' in position 0: Body ('‰') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/util/custom.py", line 24, in rest_call
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 974, in send_raw_request
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/sessions.py", line 655, in send
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/adapters.py", line 439, in send
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 699, in urlopen
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 394, in _make_request
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connection.py", line 239, in request
  File "http\client.py", line 1282, in request
  File "http\client.py", line 1327, in _send_request
  File "http\client.py", line 166, in _encode
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2030' in position 0: Body ('‰') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • $logoBytes = Get-Content ..\logo.png -Raw
  • az rest --method PUT --uri "https://graph.microsoft.com/v1.0/applications/$MYAPPID/logo" --headers 'Content-Type=image/png' --body $logoBytes

Expected Behavior

Environment Summary

Windows-10-10.0.22621-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.37.0 *

Extensions:
account 0.2.1
application-insights 0.1.16
containerapp 0.3.7
storage-preview 0.8.3

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamGraph(doesn't work with label-triggered comments; use Graph.Microsoft instead) az adact-identity-squadfeature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions