Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

az rest fails to upload a file to an integration account if the file contains special latin characters i.e. ä #15288

Open 345James opened 4 years ago

345James commented 4 years ago

Describe the bug

When trying to store an XML schema into an integration account using the az rest command and the management api, the schema fails to be uploaded if the schema contains latin special characters i.e. í or ä.

The same schema can be loaded into the integration account, by using the same management api and curl.

Command Name az rest --method PUT

Errors:

ValidationError: Bad Request({"error":{"code":"InvalidRequestContent","message":"The request content is not valid and could not be deserialized: 'Unable to translate bytes [E4] at index 538 from specified code page to Unicode.'."}})

To Reproduce:

Steps to reproduce the behavior.

az rest --method PUT --headers Content-Type='application/json; charset=utf-8'  
       --uri  https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName/schemas/schema1?api-version=2019-05-01 
       --body @$requestBodyFile 

Expected Behavior

The schema is uploaded to the integration account

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.12.0

Extensions:
application-insights 0.1.8

Additional Context

yonzhan commented 4 years ago

add to S176