Azure / azure-cli

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

source id is not optional, should be listed as required attribute #20899

Open lindacmsheard opened 2 years ago

lindacmsheard commented 2 years ago

[Enter feedback here] (using "azure-cli": "2.31.0")

contrary to the docs, --source-resource-id appears to be a required parameter for az eventgrid event-subscription show (and possibly for the other operations too)?

Leaving it off results in an unhandled error:

az eventgrid event-subscription show --name $subname
// ->
The command failed with an unexpected error. Here is the traceback:
No value for given attribute
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 658, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 721, 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 692, 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 363, in handler
    show_exception_handler(ex)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/arm.py", line 429, in show_exception_handler
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 361, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/eventgrid/custom.py", line 873, in cli_eventgrid_event_subscription_get
    retrieved_event_subscription = client.get(source_resource_id, event_subscription_name)
  File "/opt/az/lib/python3.6/site-packages/azure/mgmt/eventgrid/operations/_event_subscriptions_operations.py", line 88, in get
    'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
  File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 650, in url
    output = self.serialize_data(data, data_type, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 758, in serialize_data
    raise ValueError("No value for given attribute")
ValueError: No value for given attribute

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ghost commented 2 years ago

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

Issue Details
[Enter feedback here] (using "azure-cli": "2.31.0") contrary to the docs, `--source-resource-id` appears to be a required parameter for `az eventgrid event-subscription show` (and possibly for the other operations too)? Leaving it off results in an unhandled error: ``` az eventgrid event-subscription show --name $subname // -> The command failed with an unexpected error. Here is the traceback: No value for given attribute 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 658, in execute raise ex File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 721, 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 692, 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 363, in handler show_exception_handler(ex) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/arm.py", line 429, in show_exception_handler raise ex File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 361, in handler return op(**command_args) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/eventgrid/custom.py", line 873, in cli_eventgrid_event_subscription_get retrieved_event_subscription = client.get(source_resource_id, event_subscription_name) File "/opt/az/lib/python3.6/site-packages/azure/mgmt/eventgrid/operations/_event_subscriptions_operations.py", line 88, in get 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 650, in url output = self.serialize_data(data, data_type, **kwargs) File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 758, in serialize_data raise ValueError("No value for given attribute") ValueError: No value for given attribute ``` --- #### Document Details ⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.* * ID: 63e73e1b-aad9-0ce8-be1f-a9b9d02ca6d4 * Version Independent ID: 73525c5f-94f3-1c07-e3b6-3a022aab2a10 * Content: [az eventgrid event-subscription](https://docs.microsoft.com/en-us/cli/azure/eventgrid/event-subscription?view=azure-cli-latest) * Content Source: [latest/docs-ref-autogen/eventgrid/event-subscription.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/latest/docs-ref-autogen/eventgrid/event-subscription.yml) * Service: **event-grid** * GitHub Login: @rloutlaw * Microsoft Alias: **routlaw**
Author: lindacmsheard
Assignees: -
Labels: `Service Attention`, `Event Grid`
Milestone: -
yonzhan commented 2 years ago

route to service team