Skip to content

az rest does not support POSTing binary data #22810

@bb-froggy

Description

@bb-froggy

Related command
az rest

Is your feature request related to a problem? Please describe.
I want to upload a logo for an application registration. MS Graph requires this to be uploaded binary, but az rest Base64-encodes it. I tried
az rest --method put --headers ContentType=image/png --url https://graph.microsoft.com/v1.0/applications/0b1ec71d-0f88-a661-1ca7-104888888888/logo --body @image.png

Describe the solution you'd like
az rest should support a parameter to read the body from a file binary, like --body-file.
Alternatively, enforce uploading the data as-is via a parameter (would also fix this: )

Describe alternatives you've considered
It is possible to upload a logo using other REST clients, like the .NET Graph Client.

az ad app update does not offer any parameter to upload a logo.

Additional context
This addition would also solve this use case: https://stackoverflow.com/questions/63413704/azure-cli-rest-issue-with-encoding-german-umlauts

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botGraph(doesn't work with label-triggered comments; use Graph.Microsoft instead) az adact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions