linux_web_app
: PUT request does not include ipSecurityRestrictionsDefaultAction
property on resource update
#25517
Labels
Is there an existing issue for this?
Community Note
Terraform Version
1.7.4
AzureRM Provider Version
3.97.1
Affected Resource(s)/Data Source(s)
azurerm_linux_web_app
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The Terraform provider performs an update on the Web App resource. Since it uses a PUT request for that, it should include the
ipSecurityRestrictionsDefaultAction
property which got recently introduced in #25131.We are using Azure Policies to validate that App Services always have the default action set to "Deny" in case the resource has public network access enabled. Azure Policies in "deny" mode can only evaluate the payload of the deployment request, not the actual current resource configuration in case the resource already exists. If a Web App already has
ipSecurityRestrictionsDefaultAction
set to "Deny", but PUT API requests updating that resource don't include the property, there is no way for the policy framework to evaluate it.This behavior is limited to PUT requests. If you were to use a PATCH request, the Azure Management API would calculate the diff on the existing resource before handing over the deployment request to the policy evaluation framework (at least that is my understanding, which might be wrong, since there is no documentation whatsoever on this).
Bottom line is: If you do PUT requests, you have to include ALL resource properties in the request and the Azure Policy framework expects you to do so. This is in line with RFC 5789.
Note that I have been trying to explain that in length back in #24519 (comment) before that PR got closed.
Actual Behaviour
The Terraform provider only includes the
ipSecurityRestrictionsDefaultAction
property in its PUT request when you change it. Same goes forscmIpSecurityRestrictionsDefaultAction
.Steps to Reproduce
Deploy a azurerm_linux_web_app resource with
public_network_access_enabled = true
andip_restriction_default_action = "Deny"
.Set the log level to debug.
Update some properties in the azurerm_linux_web_app resource. The logged PUT request won't include the
ip_restriction_default_action
property.Important Factoids
No response
References
azurerm_windows_web_app
,azurerm_windows_web_app_slot
,azurerm_linux_web_app
,azurerm_linux_web_app_slot
- add the default ip action #24519The text was updated successfully, but these errors were encountered: