Hello,
I'm trying to use Azure CLI command to add Hybrid Connection to the app service slot, but it failed with error:
The command failed with an unexpected error. Here is the traceback:
Unable to build a model: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get', DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1428, in _deserialize
found_value = key_extractor(attr, attr_desc, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1193, in rest_key_case_insensitive_extractor
return attribute_key_case_insensitive_extractor(key, None, working_data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1222, in attribute_key_case_insensitive_extractor
return data.get(found_key)
AttributeError: 'str' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 620, in body
data = deserializer._deserialize(data_type, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1446, in _deserialize
raise_with_traceback(DeserializationError, msg, err)
File "/opt/az/lib/python3.6/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
raise error.with_traceback(exc_traceback)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1428, in _deserialize
found_value = key_extractor(attr, attr_desc, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1193, in rest_key_case_insensitive_extractor
return attribute_key_case_insensitive_extractor(key, None, working_data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1222, in attribute_key_case_insensitive_extractor
return data.get(found_key)
msrest.exceptions.DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 657, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 720, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 691, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 328, in call
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 3413, in add_hc
hybrid_connection, hc, slot)
File "/opt/az/lib/python3.6/site-packages/azure/mgmt/web/v2020_09_01/operations/_web_apps_operations.py", line 18092, in create_or_update_hybrid_connection_slot
body_content = self._serialize.body(connection_envelope, 'HybridConnection')
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 623, in body
SerializationError, "Unable to build a model: "+str(err), err)
File "/opt/az/lib/python3.6/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
raise error.with_traceback(exc_traceback)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 620, in body
data = deserializer._deserialize(data_type, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1446, in _deserialize
raise_with_traceback(DeserializationError, msg, err)
File "/opt/az/lib/python3.6/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
raise error.with_traceback(exc_traceback)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1428, in _deserialize
found_value = key_extractor(attr, attr_desc, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1193, in rest_key_case_insensitive_extractor
return attribute_key_case_insensitive_extractor(key, None, working_data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1222, in attribute_key_case_insensitive_extractor
return data.get(found_key)
msrest.exceptions.SerializationError: Unable to build a model: Unable to deserializeto object: type, AttributeError: 'str' object has no attribute 'get', DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
I'm using command copy-pasted from documentation:
az webapp hybrid-connection add -g MyResourceGroup -n MyWebapp --namespace [HybridConnectionNamespace] --hybrid-connection [HybridConnectionName] -s [slot]
https://learn.microsoft.com/en-us/cli/azure/webapp/hybrid-connection?view=azure-cli-latest#az_webapp_hybrid_connection_add-examples
Is there a possibility that I'm using it wrongly?