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

Update various files to not set SiteConfig.PublicNetworkAccess. #25794

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pauldotknopf
Copy link

@pauldotknopf pauldotknopf commented Apr 29, 2024

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 👍 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

  • 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 written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • 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

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

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)

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):

  • Bug Fix

@Mechanolatry
Copy link

@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)

@pauldotknopf
Copy link
Author

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

@Apokalypt
Copy link
Contributor

Apokalypt commented Apr 30, 2024

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, ...

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}
@github-actions github-actions bot added size/S and removed size/XS labels Apr 30, 2024
@pauldotknopf pauldotknopf changed the title Update linux_function_app_resource.go Update various files to not set SiteConfig.PublicNetworkAccess. Apr 30, 2024
@pauldotknopf
Copy link
Author

@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.

@sec0ndhand
Copy link

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

@santhoshdesikachari
Copy link

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

@PG-RichT
Copy link

PG-RichT commented May 1, 2024

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?

@Jeffrey20241
Copy link

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

@madsd
Copy link

madsd commented May 8, 2024

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.

@hoopdad
Copy link

hoopdad commented May 14, 2024

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!

@madsd
Copy link

madsd commented May 15, 2024

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).

@dkuzmenok
Copy link
Contributor

@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."]}}]

@madsd
Copy link

madsd commented May 15, 2024

@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

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.

None yet