terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

Update various files to not set SiteConfig.PublicNetworkAccess.

Open pauldotknopf opened this issue 9 months ago • 9 comments

Latest Azure API changes throws errors if this setting is present in both locations:

performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with response: {"Code":"BadRequest","Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be modified. Please modify the Site.PublicNetworkAccess property.","Target":null,"Details":[{"Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be modified. Please modify the Site.PublicNetworkAccess property."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"01020","MessageTemplate":"There was a conflict. {0}","Parameters":["SiteConfig.PublicNetworkAccess cannot be modified. Please modify the Site.PublicNetworkAccess property."],"Code":"BadRequest","Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be modified. Please modify the Site.PublicNetworkAccess property."}}],"Innererror":null}

Community Note

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

Description

PR Checklist

  • [x] I have followed the guidelines in our Contributing Documentation.
  • [x] I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • [x] I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • [x] I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • [x] I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work. For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • [x] 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).
  • [x] I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • [x] I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • [x] (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • [x] 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)

Change Log

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

  • azurerm_resource - support for the thing1 property [GH-00000]

This is a (please select all that apply):

  • [x] Bug Fix

pauldotknopf avatar Apr 29 '24 14:04 pauldotknopf

@pauldotknopf - I am seeing this same issue on the azurerm_logic_app_standard resource. Will this PR address that or should I raise an new issue (This PR was the only thing I could find when looking for the error)

Mechanolatry avatar Apr 29 '24 16:04 Mechanolatry

@Mechanolatry The squeaky wheel get's the grease. I'd suggest creating a new PR for it, maybe the maintainers will consolidate them.

pauldotknopf avatar Apr 29 '24 17:04 pauldotknopf

This fix is present in many of resources due to previous Azure API behaviour. I think that the problem occurs in function_app_*, web_app_*, logic_app, ...

Apokalypt avatar Apr 30 '24 07:04 Apokalypt

@Apokalypt @Mechanolatry I've updated the various locations.

I'm unsure about how to change logic_app_standard_resource.go, so I'll leave that to someone smarter than me.

pauldotknopf avatar Apr 30 '24 08:04 pauldotknopf

Really needing this. Is there a timeline on when this will be merged?

sec0ndhand avatar Apr 30 '24 11:04 sec0ndhand

We are looking to have this PR merged. Thanks @pauldotknopf for making the change!

santhoshdesikachari avatar Apr 30 '24 11:04 santhoshdesikachari

We're experiencing a similar issue with the other property they've removed vnetRouteAllEnabled. Any chance you could address that in here too while there's still time?

PG-RichT avatar May 01 '24 14:05 PG-RichT

This change needs to be made for Logic Apps too, I believe it to be the same cause for Logic App which configure site_config, please see #25891

ghost avatar May 07 '24 16:05 ghost

We started rolling out this change to ensure Azure policy compliance with specific network related settings (Improving App Service networking configuration control). We found that Terraform is primarily using the SiteConfig versions of the properties (vnetRouteAllEnabled and publicNetworkAccess) and in some cases do not have support for setting the Site properties. This change will affect both Logic Apps, Function Apps and Web Apps. Please let me/us know if there is anything we can do to help add support. We are pausing the roll out until TF can add support for the Site properties.

madsd avatar May 08 '24 08:05 madsd

We started rolling out this change to ensure Azure policy compliance with specific network related settings (Improving App Service networking configuration control). We found that Terraform is primarily using the SiteConfig versions of the properties (vnetRouteAllEnabled and publicNetworkAccess) and in some cases do not have support for setting the Site properties. This change will affect both Logic Apps, Function Apps and Web Apps. Please let me/us know if there is anything we can do to help add support. We are pausing the roll out until TF can add support for the Site properties.

Are you able to share the Azure regions where this change has not been made yet? thank you!

hoopdad avatar May 14 '24 22:05 hoopdad

We started rolling out this change to ensure Azure policy compliance with specific network related settings (Improving App Service networking configuration control). We found that Terraform is primarily using the SiteConfig versions of the properties (vnetRouteAllEnabled and publicNetworkAccess) and in some cases do not have support for setting the Site properties. This change will affect both Logic Apps, Function Apps and Web Apps. Please let me/us know if there is anything we can do to help add support. We are pausing the roll out until TF can add support for the Site properties.

Are you able to share the Azure regions where this change has not been made yet? thank you!

We have disabled the change in all regions for now to ensure TF users will not be impacted. We are working with the team to find a way forward without impacting TF users. Let me know if you still see issues (region/site name).

madsd avatar May 15 '24 07:05 madsd

@madsd Is the rollback complete?

I just ran Logic App creation and still get same error (that is a custom tenant):

Error: creating Logic App Standard: (Site Name "***" / Resource Group "***"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property." Details=[{"Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"01020","Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property.","MessageTemplate":"There was a conflict. {0}","Parameters":["SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property."]}}]

dkuzmenok avatar May 15 '24 07:05 dkuzmenok

@madsd Is the rollback complete?

I just ran Logic App creation and still get same error (that is a custom tenant):

Error: creating Logic App Standard: (Site Name "***" / Resource Group "***"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property." Details=[{"Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"01020","Message":"There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property.","MessageTemplate":"There was a conflict. {0}","Parameters":["SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property."]}}]

Should be - would you mind sending me the site name in an email and I'll have engineering look at the cause: madsd[at]microsoft.com

madsd avatar May 15 '24 07:05 madsd

We started rolling out this change to ensure Azure policy compliance with specific network related settings (Improving App Service networking configuration control). We found that Terraform is primarily using the SiteConfig versions of the properties (vnetRouteAllEnabled and publicNetworkAccess) and in some cases do not have support for setting the Site properties. This change will affect both Logic Apps, Function Apps and Web Apps. Please let me/us know if there is anything we can do to help add support. We are pausing the roll out until TF can add support for the Site properties.

Are you able to share the Azure regions where this change has not been made yet? thank you!

We have disabled the change in all regions for now to ensure TF users will not be impacted. We are working with the team to find a way forward without impacting TF users. Let me know if you still see issues (region/site name).

We are still facing this issue. In my case, the Logic App is running in the ASE v3 - East US region. Is rollback paused for Logic App APIs too?

suneerpm avatar May 30 '24 18:05 suneerpm

RE Standard Logic Apps: Initial deploy with any configurations on app_settings and identity work, but any changes after the fact does not work. For example, if you disable a workflow, app_settings will be considered modified against terraform state (Workflow state set as a 'disabled' app_setting flag) so we have to lifecycle ignore those attributes for now.

cnnranderson avatar May 30 '24 19:05 cnnranderson

We started rolling out this change to ensure Azure policy compliance with specific network related settings (Improving App Service networking configuration control). We found that Terraform is primarily using the SiteConfig versions of the properties (vnetRouteAllEnabled and publicNetworkAccess) and in some cases do not have support for setting the Site properties. This change will affect both Logic Apps, Function Apps and Web Apps. Please let me/us know if there is anything we can do to help add support. We are pausing the roll out until TF can add support for the Site properties.

Hi, I tried to create std logic app today using the latest azurerm TF provider version (3.105.0) and it is still failing with the same error - "There was a conflict. SiteConfig.PublicNetworkAccess cannot be set by itself. Please use the Site.PublicNetworkAccess property"

snehacloudops avatar May 30 '24 20:05 snehacloudops