Azure / Azure/azure-cli

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

Open
#20,899 4 comments 1 reaction 0 assignees View on GitHub
act-codegen-extensibility-squad Event Grid Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

[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**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.