Generic update should convert camelCased keys to python_case
See original GitHub issueDescription
When i run:
az vm update -n VM_NAME-g VM_GROUP --add osProfile.secrets '{"sourceVault":{"id":"valid key vault uri"},"vaultCertificates":[{"certificateUrl": "valid uri to certificate"}]}'
I receive:
ERROR: 'sourceVault'
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\application.py", line 211, in execute
result = expanded_arg.func(params)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 346, in __call__
return self.handler(*args, **kwargs)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\arm.py", line 407, in handler
raise ex
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\arm.py", line 390, in handler
opres = setter(client, **setterargs) if client else setter(**setterargs)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\mgmt\compute\compute\v2016_04_30_preview\operations\virtual_machines_operations.py", line 180, in create_or_update
body_content = self._serialize.body(parameters, 'VirtualMachine')
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 301, in body
data = _convert_to_datatype(data, data_type, self.dependencies)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 182, in _convert_to_datatype
getattr(data, attr), mapconfig['type'], localtypes))
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 182, in _convert_to_datatype
getattr(data, attr), mapconfig['type'], localtypes))
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 156, in _convert_to_datatype
param, data_type[1:-1], localtypes) for param in data
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 156, in <listcomp>
param, data_type[1:-1], localtypes) for param in data
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 171, in _convert_to_datatype
localtypes) for key in data
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 171, in <dictcomp>
localtypes) for key in data
KeyError: 'sourceVault'
I guess updating osProfile.secrets is not yet supported (although–secrets in az vm create are) but would like to get this in Azure CLI as I am now forced to use Powershell’s Add-AzureRmVMSecret which seems to be the only option which works now for uploading certificates to VMs.
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: MSI
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here: 2.0.9
OS Version: What OS and version are you using?
Answer here: Windows 7 Enterprise
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: tested in both cmd.exe and gitbash, same results
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
TypeScript convert generic object from snake to camel case
From keysToCamelCase() It splits word by the regular expression named at the top through types and the helper function, then changes those words ......
Read more >improve docs about snake case and camel case #1295 - GitHub
I'm running into an issue with a marshmallow/swagger/javascript interaction. In javascript (and serialized json in general), field names are ...
Read more >How to UPPER_CASE to camelCase in raw Typescript generics
Today's challenge is to retype an UPPER_CASE static string into camelCase and apply this transformation recursively to the object keys. Preview.
Read more >Can I change Python SDK API response keys from snake case ...
Is there any way to maybe change the configuration of the Python SDK so the keys in the API responses are in camel...
Read more >How to deal with cases mismatch between Django and React
In this article, we explore how to deal with the casing mismatch between the JavaScript world (using camel case) and the Python /...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The changes @lmazuel is making to the SDK should automagically fix this, but I’ll do the testing and verification on the CLI side.
Thanks to @lmazuel this has been fixed for the entire Python SDK! Thanks @lmazuel!! 🎉 🎉