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

fix: avm/res/web/static-site fixes for pdns & Identity Var #4693

Open
wants to merge 94 commits into
base: main
Choose a base branch
from

Conversation

ChrisSidebotham
Copy link
Contributor

@ChrisSidebotham ChrisSidebotham commented Mar 7, 2025

Description

Closes #4345
Closes #4701

Configured DNS Record in test:
image

New DNS Zone:
image

Pipeline Reference

Pipeline
avm.res.web.static-site

Type of Change

  • Update to CI Environment or utilities (Non-module affecting changes)
  • Azure Verified Module updates:
    • Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in version.json:
      • Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description.
      • The bug was found by the module author, and no one has opened an issue to report it yet.
    • Feature update backwards compatible feature updates, and I have bumped the MINOR version in version.json.
    • Breaking changes and I have bumped the MAJOR version in version.json.
    • Update to documentation

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • I have run Set-AVMModule locally to generate the supporting module files.
  • My corresponding pipelines / checks run clean and green without any errors or warnings

ChrisSidebotham and others added 30 commits October 12, 2023 14:59
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Mar 7, 2025
@ChrisSidebotham ChrisSidebotham changed the title fix: avm/res/web/static-site Private DNS Zone Group Fix fix: avm/res/web/static-site fixes for pdns & Identity Var Mar 11, 2025
@@ -257,6 +267,14 @@ resource staticSite_roleAssignments 'Microsoft.Authorization/roleAssignments@202
}
]

module staticSite_privateDnsZone 'br/public:avm/res/network/private-dns-zone:0.7.0' = if (!empty(privateEndpoints) && createPrivateDnsZone == 'Enabled') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering the amount of properties one is able to configure in the module I wonder if we may need to introduce a parameterObject for them - like done e.g. for the nicConfigurations parameter in the VM module.

Just thinking out loud here. If you cannot configure it to you needs you're essentially required to idempotently redeploy the DNS Zone after the deployment with another deployment. Maybe that's ok and intended - but wanted to raise the thought :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So on this thought, for a VM the NIC is required, I guess here we do follow a smiliar pattern except the PDNS Zone is only needed for private endpoints to work. Typically the DNS Zone should sit with the rest of the DNS Zone and be configured with a vnet link.

In this current implemntation the app will still not be routable as the DNS Zone has not been linked to a Virtual Network, I need to update this so it accepts some properties. My view is this should be the bare minimal requirements to ensure PE connectivity is established and routable but any extensive configuration should be done in a dedicated module for the staticSite zone. il make an update to this today

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additional param added for virtualNetworkResourceId

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if that's something we should chat about some time - just to ensure we're all on the same page. The next maintainer call would come to mind 💪

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we let this go in the meantime?

Copy link
Contributor

@AlexanderSehr AlexanderSehr Mar 22, 2025

Choose a reason for hiding this comment

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

Define "Let go"? Should we not find together the best solution instead of potentially introducing multiple breaking changes? Hence the suggestion with the Maintainer call where these design questions would usually be brought up. Like the one last Thursday.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#4345 has been open since Jan 29th, here we are talking about a new resource call which is being updated. I would rather us push this change to resolve the current and very limited issue then look at refinements on a wider basis following this. I am unsure what we have to discuss around this, it should be a simply implementation unless the user brings there own DNS Zone?

@@ -301,7 +327,15 @@ module staticSite_privateEndpoints 'br/public:avm/res/network/private-endpoint:0
'Full'
).location
lock: privateEndpoint.?lock ?? lock
privateDnsZoneGroup: privateEndpoint.?privateDnsZoneGroup
privateDnsZoneGroup: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please note. the Interface still allows the user to define a custom privateDnsZoneGroup even though the module would ignore it.
Either this module should implement its on PE interface and essentially not allow the user to set the privateDnsZoneGroup - or - this could be changed to something like

privateDnsZoneGroup: privateEndpoint.?privateDnsZoneGroup ?? {

To, in theory still allow the user to bring a private DNS Zone. Otherwise it would appear quite confusing that the parameter is there, but its value would be thrown away if you catch my drift 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Come to think of it, it would probably be a good call to call this also out in the description of the privateEndpoints parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the intended behaviour, in most cases DNS Zones are stored centrally so the user will want to BYODnsZone ...

However I have updated the PE Description now

@eriqua eriqua removed the Needs: Triage 🔍 Maintainers need to triage still label Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Core Team 🧞 This item needs the AVM Core Team to review it Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
3 participants