az rest does not support POSTing binary data
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**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
Contributor guide
Assessment
This issue has not been assessed yet.