question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az monitor diganostic setting command failing since today

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az monitor diagnostic-settings create --resource --name --event-hub --event-hub-rule --logs '[{"category": "FunctionAppLogs", "enabled": true, "retentionPolicy": { "enabled": false, "days": 0 }}]' --debug

Errors:

The command failed with an unexpected error. Here is the traceback:
'AAZCommandCtx' object has no attribute 'resource'
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/aaz/_command.py", line 145, in __call__
    return self._handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/monitor/aaz/latest/monitor/diagnostic_settings/_create.py", line 33, in _handler
    self._execute_operations()
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/monitor/aaz/latest/monitor/diagnostic_settings/_create.py", line 176, in _execute_operations
    self.pre_operations()
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/monitor/operations/diagnostics_settings.py", line 98, in pre_operations
    rg = parse_resource_id(ctx.resource)['resource_group']
AttributeError: 'AAZCommandCtx' object has no attribute 'resource'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az monitor diagnostic-settings create --resource {} --name {} --event-hub {} --event-hub-rule {} --logs {} --debug

Expected Behavior

I expect the diagnosti setting to be created. It has been working yesterday but suddenly it stopped working today.I am runnign this step throgh the Azure devops pipeline, but it seems it does not even work locally.

Environment Summary

Linux-5.4.0-1098-azure-x86_64-with-glibc2.35 (Cloud Shell), CBL-Mariner/Linux
Python 3.9.14
Installer: RPM

azure-cli 2.43.0

Extensions:
ai-examples 0.2.5
ml 2.11.0
ssh 1.1.3

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
raunaknarookacommented, Dec 15, 2022

Yes it works, thanks. I am wondering, where can we get a notification of such breaking changes in the command?

0reactions
msftbot[bot]commented, Dec 15, 2022

Hi @raunaknarooka. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Diagnostic settings in Azure Monitor - Microsoft Learn
Send Azure Monitor platform metrics and logs to Azure Monitor Logs, Azure Storage, or Azure Event Hubs by using a diagnostic setting.
Read more >
Using the Azure cli to automate the creation of Diagnostic ...
If you want to get available categories for one resource, you can use the following command az monitor diagnostic-settings categories list ...
Read more >
azure-cli-monitor 0.2.15 - PyPI
Microsoft Azure Command-Line Tools Monitor Command Module. ... monitor diagnostic-settings create : Improve validation for arguments –event-hub and ...
Read more >
Configure Diagnostic Setting Categories - Trend Micro
An Azure Monitor diagnostic setting controls how the diagnostic logs are exported. ... 01 Run az monitor diagnostic-settings subscription update command ...
Read more >
Azure Diagnostic Settings Deletion - Elastic
filebeat-*; logs-azure*. Severity: medium. Risk score: 47. Runs every: 5 minutes. Searches indices from: now-25m ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found