Skip to content

{Monitor} az monitor metrics alert update: fix update action issue - #17289

Merged
kai ru (kairu-ms) merged 1 commit into
Azure:devfrom
kairu-ms:fix-17268-issue-monitor-metrics-alert
Mar 17, 2021
Merged

kai ru (kairu-ms) merged 1 commit into
Azure:devfrom
kairu-ms:fix-17268-issue-monitor-metrics-alert

Conversation

@kairu-ms

@kairu-ms kai ru (kairu-ms) commented Mar 12, 2021

Copy link
Copy Markdown
Contributor

Closed #17268

webhook_properties property has been renamed in SDK. In order to avoid this kind of breaking change, I rewrite the code to eliminate the dependency on this property.

Description

Testing Guide

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.

@kairu-ms

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

Monitor

instance.actions.append(action)
add_action_ids = {x.action_group_id.lower() for x in add_actions}
instance.actions = [x for x in instance.actions if x.action_group_id.lower() not in add_action_ids]
instance.actions.extend(add_actions)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use match for webhook_properties now? What does this change mean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 'add_actions', the logical of original code is that if that action already exist then update its properties. Now I change the logic, if that action already exist, remove the old one and add the new one.

@kairu-ms
kai ru (kairu-ms) merged commit b685dbb into Azure:dev Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception in an attempt to remove and add action group for a metric alert rule

4 participants