This is autogenerated. Please review and update as needed.
Describe the bug
Receiving a Python error for unused resource_group key when trying to create a diagnostic setting to export subscription level events to an event hub in another subscription.
Command Name
az monitor diagnostic-settings create
Errors:
$ az monitor diagnostic-settings create \
--name "Audit" \
--resource /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
--logs '[{"category": "Administrative","enabled": true}, {"category": "Security","enabled": true}, {"category": "Policy","enabled": true}]' \
--event-hub-rule "/subscriptions/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/resourcegroups/Security-Events/providers/Microsoft.EventHub/namespaces/Azure-Security-Event-Hub/eventhubs/azuresecurityevents/authorizationrules/GlobalSubscritpionAccess"
The command failed with an unexpected error. Here is the traceback:
'resource_group'
Traceback (most recent call last):
File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/aaz/_command.py", line 149, in __call__
return self._handler(*args, **kwargs)
File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/monitor/aaz/latest/monitor/diagnostic_settings/_create.py", line 33, in _handler
self._execute_operations()
File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/monitor/aaz/latest/monitor/diagnostic_settings/_create.py", line 176, in _execute_operations
self.pre_operations()
File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/monitor/operations/diagnostics_settings.py", line 100, in pre_operations
rg = parse_resource_id(args.resource.to_serialized_data())['resource_group']
KeyError: 'resource_group'
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Create two subscriptions, one is an event source the second is for an event hub
- Create event hub in one subscription to receive events
- Attempt to use the diagnostic-settings command to create an export to send subscription security events to the event hub
Expected Behavior
Should be able to use the diagnostic-settings create command from the CLI tool to create a diagnostic export rule. When I don't have permissions to the event hub rule, I should instead get an error that I don't have permissions to list the keys of the event hub rule.
Environment Summary
Linux-5.15.0-71-generic-x86_64-with-glibc2.35, Ubuntu 22.04.2 LTS
Python 3.10.10
Installer: DEB
azure-cli 2.48.1
Extensions:
account 0.2.1
azure-devops 0.18.0
datamigration 0.4.1
kusto 0.4.0
Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0
Additional Context
This is autogenerated. Please review and update as needed.
Describe the bug
Receiving a Python error for unused
resource_groupkey when trying to create a diagnostic setting to export subscription level events to an event hub in another subscription.Command Name
az monitor diagnostic-settings createErrors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
Expected Behavior
Should be able to use the diagnostic-settings create command from the CLI tool to create a diagnostic export rule. When I don't have permissions to the event hub rule, I should instead get an error that I don't have permissions to list the keys of the event hub rule.
Environment Summary
Additional Context