Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_windows_web_app, azurerm_linux_web_app - fix auto heal issue, support path in slow_reuqest_trigger block #18227

Closed
wants to merge 1 commit into from

Conversation

xiaxyi
Copy link
Contributor

@xiaxyi xiaxyi commented Sep 2, 2022

Fix #17862
fix #19256

acc tests:

--- PASS: TestAccWindowsWebApp_withAutoHealRulesSlowRequestWithPath (387.40s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    388.175s
--- PASS: TestAccLinuxWebApp_withAutoHealRulesSlowRequestWithPath (471.79s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    472.729s


Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @xiaxyi - Thanks for this PR.
I think two changes have been conflated here and are making this difficult to review correctly. The change to the schema for path looks unrelated to the issue being addressed, and as far as I can tell is not necessary at all? Am I missing something?

@xiaxyi
Copy link
Contributor Author

xiaxyi commented Oct 19, 2022

Thanks @jackofallops for the comments, as you can tell from the code, this pr is trying to address two issues:

  1. fix the status code not being set issue as mentioned in azurerm_windows_web_app: autoheal settings "sub_status" and "win32_status" are not set #17862
  2. add support for auto heal rule for user to be able to set the slow request path in the auto heal trigger rule. There are two properties in the api: SlowRequests *SlowRequestsBasedTrigger and SlowRequestsWithPath *[]SlowRequestsBasedTrigger. We only provided the first option.

@xiaxyi
Copy link
Contributor Author

xiaxyi commented Oct 19, 2022

@jackofallops this is the api response by setting the trigger with & without path:

  "slowRequests": {
                    "timeTaken": "00:00:10",
                    "path": null,
                    "count": 10,
                    "timeInterval": "00:10:00"
                },
                "slowRequestsWithPath": [
                    {
                        "timeTaken": "00:00:11",
                        "path": "/xiaxintest1",
                        "count": 11,
                        "timeInterval": "00:11:00"
                    },
                    {
                        "timeTaken": "00:00:12",
                        "path": "/xiaxintest2",
                        "count": 12,
                        "timeInterval": "00:12:00"
                    }
                ],

just for your reference, you can try below config to have more information:

resource "azurerm_windows_web_app" "dotnet" {
  name                = "xiaxintestWA-autoheal"
  location            = azurerm_resource_group.test.location
  resource_group_name = azurerm_resource_group.test.name
  service_plan_id     = azurerm_service_plan.test.id

  site_config {
    application_stack {
      dotnet_version = "core3.1"
      current_stack  = "dotnetcore"
    }
    auto_heal_enabled = true

    auto_heal_setting {
      trigger {
        slow_request {
          count      = "10"
          interval   = "00:10:00"
          time_taken = "00:00:10"
          path       = null
        }
        slow_request_with_path {
          count      = "11"
          interval   = "00:11:00"
          time_taken = "00:00:11"
          path       = "/xiaxintest1"
        }
        slow_request_with_path {
          count      = "12"
          interval   = "00:12:00"
          time_taken = "00:00:12"
          path       = "/xiaxintest2"
        }
        status_code {
          status_code_range = "400"
          interval          = "00:01:00"
          count             = 10
          win32_status = "202"
        }
      }

      action {
        action_type                    = "Recycle"
        minimum_process_execution_time = "00:05:00"
      }
  }
  }
}

@xiaxyi xiaxyi changed the title azurerm_windows_web_app, azurerm_linux_web_app: fix auto heal issue, support path in slow_reuqest_trigger block azurerm_windows_web_app, azurerm_linux_web_app - fix auto heal issue, support path in slow_reuqest_trigger block Nov 11, 2022
@jackofallops jackofallops mentioned this pull request Dec 14, 2022
1 task
@jackofallops
Copy link
Member

Closing as superseded by 19685.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants