Skip to content

azurerm_monitor_scheduled_query_rules_alert_v2: add support for email_subject within action block#32132

Merged
toddgiguere merged 1 commit intohashicorp:mainfrom
sojournerdev:azure-monitor-alert
Apr 13, 2026
Merged

azurerm_monitor_scheduled_query_rules_alert_v2: add support for email_subject within action block#32132
toddgiguere merged 1 commit intohashicorp:mainfrom
sojournerdev:azure-monitor-alert

Conversation

@sojournerdev
Copy link
Copy Markdown
Contributor

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

This PR supersedes my previous PR for the same change. I had to open a new PR because my original fork was deleted.

This change adds support for configuring email_subject inside the action block of the azurerm_monitor_scheduled_query_rules_alert_v2 resource.

With this enhancement, users can customize the subject line of alert emails, bringing the Terraform resource in line with Azure Monitor’s support for overriding the default subject. Without this argument, alert emails use a generic subject line, which can make triage more difficult when teams are handling multiple alerts.

Reference: Azure Monitor documentation on customizing email subject lines

This is a non-breaking enhancement because:

  • email_subject is optional.

This is a non-breaking enhancement:

  • The argument is optional.
  • Default behavior remains unchanged if the property is not set.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added documentation as required, including an example of using email_subject inside the action block.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Acceptance Testing

A full test run log has been attached: test.log

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

This is a (please select all that apply):

  • Enhancement

Related Issue(s)

Fixes #30540

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@toddgiguere
Copy link
Copy Markdown
Contributor

All tests passing except for 2, which are ongoing failures and unrelated: https://hashicorp.teamcity.com/buildConfiguration/TF_AzureRM_AZURERM_SERVICE_PUBLIC_MONITOR/645074

Comment thread internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource_test.go Outdated
@toddgiguere
Copy link
Copy Markdown
Contributor

toddgiguere commented Apr 9, 2026

@sojournerdev I only had one very minor change request within the tests. Other than that this is looking good and all of our tests with this approach are working.

@toddgiguere
Copy link
Copy Markdown
Contributor

Since tests had a change, reran just those tests, all succeeded: https://hashicorp.teamcity.com/buildConfiguration/TF_AzureRM_AZURERM_SERVICE_PUBLIC_MONITOR/647597

@toddgiguere toddgiguere merged commit c7ee37f into hashicorp:main Apr 13, 2026
31 checks passed
@github-actions github-actions bot added this to the v4.69.0 milestone Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for custom email subject in azurerm_monitor_scheduled_query_rules_alert_v2

2 participants