Skip to content

Conversation

@haroldrandom
Copy link
Contributor

@haroldrandom haroldrandom commented Dec 14, 2020

Description

One of fix for #14988

Testing Guide
To reproduce via run:

az monitor metrics alert create -n alert1 -g harold --scopes /subscriptions/0000-0000/resourceGroups/xxxxx/providers/Microsoft.Compute/virtualMachines/xxxx/extensions/MicrosoftMonitoringAgent --condition "avg Percentage CPU > 90" --window-size 5m --evaluation-frequency 1m --description "High CPU Usage"  --action /subscriptions/xxxx/resourceGroups/xxxx/providers/microsoft.insights/actionGroups/xxxx apiKe

And the subsequently error output would be like:

  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1969, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1946, in consume_positionals
    take_action(action, args)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1855, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1152, in __call__
    subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
  File "/home/harold/Microsoft/azure-cli/src/azure-cli-core/azure/cli/core/parser.py", line 289, in parse_known_args
    self._namespace, self._raw_arguments = super().parse_known_args(args=args, namespace=namespace)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1781, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1969, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1946, in consume_positionals
    take_action(action, args)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1855, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1152, in __call__
    subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
  File "/home/harold/Microsoft/azure-cli/src/azure-cli-core/azure/cli/core/parser.py", line 289, in parse_known_args
    self._namespace, self._raw_arguments = super().parse_known_args(args=args, namespace=namespace)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1781, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1987, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1927, in consume_optional
    take_action(action, args, option_string)
  File "/home/harold/.pyenv/versions/3.7.4/lib/python3.7/argparse.py", line 1855, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/harold/Microsoft/azure-cli/src/azure-cli/azure/cli/command_modules/monitor/actions.py", line 152, in __call__
    web_hook_properties=dict(x.split('=', 1) for x in values[1:]) if len(values) > 1 else None
ValueError: dictionary update sequence element #0 has length 1; 2 is required

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@haroldrandom haroldrandom added the Monitor - Alerts az monitor alert label Dec 14, 2020
@haroldrandom haroldrandom self-assigned this Dec 14, 2020
@haroldrandom haroldrandom added this to the S180 milestone Dec 14, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 14, 2020

Monitor

@yonzhan yonzhan requested review from jsntcy and kairu-ms December 14, 2020 05:56
@haroldrandom haroldrandom marked this pull request as ready for review December 14, 2020 06:14
@haroldrandom haroldrandom requested a review from msyyc as a code owner December 14, 2020 06:14
@haroldrandom haroldrandom merged commit 359b9ff into Azure:dev Dec 14, 2020
@haroldrandom haroldrandom deleted the metrics-alert-fail branch December 14, 2020 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Alerts az monitor alert

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants