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 log settings constant re-apply #16876

Open
1 task done
RackPhilO opened this issue May 19, 2022 · 5 comments
Open
1 task done

azurerm_windows_web_app log settings constant re-apply #16876

RackPhilO opened this issue May 19, 2022 · 5 comments

Comments

@RackPhilO
Copy link

RackPhilO commented May 19, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.7

AzureRM Provider Version

3.6.0

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app

Terraform Configuration Files

resource "azurerm_windows_web_app" "example" {
  name                = "example"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_service_plan.example.location
  service_plan_id     = azurerm_service_plan.example.id

  site_config {}
  logs {
    detailed_error_messages = true
    failed_request_tracing  = true
    application_logs {
      file_system_level = "Information"
      azure_blob_storage {
        level             = "Information"
        sas_url           = "${azurerm_storage_container.api-ui-log.id}${data.azurerm_storage_account_blob_container_sas.api-ui-log.sas}"
        retention_in_days = var.log_rention_policy_days
      }
    }
    http_logs {
      azure_blob_storage {
        sas_url           = "${azurerm_storage_container.api-ui-log.id}${data.azurerm_storage_account_blob_container_sas.api-ui-log.sas}"
        retention_in_days = var.log_rention_policy_days
      }
    }
  }
}

Debug Output/Panic Output

~ logs {
            # (2 unchanged attributes hidden)

          + application_logs {
              + file_system_level = "Information"

              + azure_blob_storage {
                  + level             = "Information"
                  + retention_in_days = 90
                  + sas_url           = (sensitive)
                }
            }

Expected Behaviour

The app service logs will by default turn themselves off after 12 hours . If you have defined a block of code including them there is no option to set the level to Off as per the resource ..

image

The schema does not have an option for 'Off' >>

func applicationLogSchema() *pluginsdk.Schema {
return &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"file_system_level": {
Type: pluginsdk.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
string(web.LogLevelError),
string(web.LogLevelInformation),
string(web.LogLevelVerbose),
string(web.LogLevelWarning),
}, false),
},

"azure_blob_storage": appLogBlobStorageSchema(),
},
},
}
}

The deprecated app_service resource did

App Service =
file_system_level - (Optional) Log level for filesystem based logging. Supported values are Error, Information, Verbose, Warning and Off. Defaults to Off.

Web App =
file_system_level - (Required) Log level. Possible values include: Verbose, Information, Warning, and Error.

Actual Behaviour

Service default to Off after 12 hours so any subsequent re-apply via code will trigger a change . Would like to be able to set the code to off and allow the blob storage section to be applied without 'flip flopping' in the code

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@RackPhilO RackPhilO added the bug label May 19, 2022
@github-actions github-actions bot removed the bug label May 19, 2022
@xiaxyi
Copy link
Contributor

xiaxyi commented May 25, 2022

checking the detailed practice both from windows app and Linux app, will update the code accordingly.

@ptpu
Copy link

ptpu commented Feb 7, 2023

Hey, any updates on that? We would like to deactivate the file_system_level too and just use azure_blob_storage

@validis-ad
Copy link

validis-ad commented Nov 6, 2023

I'm not sure why the bug label was removed as it strikes me as quite obviously a bug. Terraform is conflicting with the expectations of the platform. I suppose it could come down to semantics, but on the face of it the module is the "bad actor" here, breaking any sense of idempotence.

@ValeruS
Copy link

ValeruS commented Jan 31, 2024

Any updates ?

@ptpu
Copy link

ptpu commented Oct 15, 2024

Updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants