Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

--destination-name parameter is not optional during first time setup of capture for eventhub #28347

Open ambhatia opened 7 months ago

ambhatia commented 7 months ago

Describe the bug

--destination-name parameter is not optional during first time setup of capture for eventhub. and not adding that in command results in poor error which doesn't even hints that create/update eventhub failed due to not specifying --destination-name .

az eventhubs eventhub create --name azcaptureeh --namespace-name ambhatiaehbdr --resource-group ambhatiaehbrg --enable-capture true --storage-account "/subscriptions/1da6539d-2c29-426a-b770-230f4ed67a93/resourceGroups/ambhatiatempstgrg/providers/Microsoft.Storage/storageAccounts/ambhatiatempstg"

cli.azure.cli.core.azclierror: (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. Code: RequestJsonDeserializationFailure Message: Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. az_command_data_logger: (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. Code: RequestJsonDeserializationFailure Message: Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246.

Related command

az eventhubs eventhub create --name azcaptureeh --namespace-name ambhatiaehbdr --resource-group ambhatiaehbrg --enable-capture true --storage-account "/subscriptions/1da6539d-2c29-426a-b770-230f4ed67a93/resourceGroups/ambhatiatempstgrg/providers/Microsoft.Storage/storageAccounts/ambhatiatempstg"

Errors

cli.azure.cli.core.azclierror: (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. Code: RequestJsonDeserializationFailure Message: Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. az_command_data_logger: (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. Code: RequestJsonDeserializationFailure Message: Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246.

Issue script & Debug output

az eventhubs eventhub create --name azcaptureeh --namespace-name ambhatiaehbdr --resource-group ambhatiaehbrg --enable-capture true --storage-account "/subscriptions/XXXX/resourceGroups/ambhatiatempstgrg/providers/Microsoft.Storage/storageAccounts/ambhatiatempstg"

cli.azure.cli.core.azclierror: (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. Code: RequestJsonDeserializationFailure Message: Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. az_command_data_logger: (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246. Code: RequestJsonDeserializationFailure Message: Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination', line 1, position 246.

Expected behavior

Command could take some default value and avoid failure or error message should suggest clearly what's missed.

Environment Summary

azure-cli 2.57.0 core 2.57.0 telemetry 1.1.0

Extensions: ai-examples 0.2.5 ml 2.22.0 ssh 2.0.2

Dependencies: msal 1.26.0 azure-mgmt-resource 23.1.0b2

Additional context

No response

yonzhan commented 7 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 7 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Saglodha.

Saglodha commented 4 months ago

Thanks for reporting @ambhatia . We'll investigate on the behavior, and I shall circle back with updates.

schaudhari6254888 commented 1 month ago

Hey @ambhatia, The --destination-name parameter is required. when --enable-capture is true. also error msg is correctly shown below. (RequestJsonDeserializationFailure) Failed to deserialize input. Got error message: Required property 'name' not found in JSON. Path 'properties.captureDescription.destination',