Skip to content

feat: Web-Site - Merge config variants #5083

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

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

Conversation

AlexanderSehr
Copy link
Contributor

@AlexanderSehr AlexanderSehr commented Apr 18, 2025

Description

  • Similar to what we did for the DigitalTwin module, these config-variants should be merged into one proper child module, exposing the different feature sets using discriminated types.
  • Added a bunch of UDTs
  • Merge very few tests to ease testing their combined configuration
  • Added a property to allow users to define whether they want to 'retain' the original app-settings when deploying the module (so far it was always doing that, which 'should' have made it impossible to remove settings via IaC)
  • Merged slots outputs
  • Fixes
    • Updated the scope of slot-level deployments to the slot scope (in the current version they 'should' overwrite the parent incorrectly (cc: @tsc-buddy, @pankajagrawal16)
    • Fixed incorrect PE tests for slots (- wasn't noticed as slots did not have a UDT)
  • Added dnsConfiguration

Closes #4252
Closes #4385

Pipeline Reference

Pipeline
avm.res.web.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

Example Slot App Settings (Config):
image

Example Auth Settings (Config)
image

Example Log Settings (Config)
image

Example API Settings (Config)
image

@AlexanderSehr AlexanderSehr added Class: Resource Module 📦 This is a resource module and removed Needs: Triage 🔍 Maintainers need to triage still labels Apr 22, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue label Apr 22, 2025
@avm-team-linter avm-team-linter bot added the Needs: Core Team 🧞 This item needs the AVM Core Team to review it label May 5, 2025
name: slotName
}
}
resource msdeploy 'Microsoft.Web/sites/slots/extensions@2024-04-01' = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @tsc-buddy & @pankajagrawal16,
this is the interesting case where the original resource type was

resource msdeploy 'Microsoft.Web/sites/extensions@2024-04-01' = {

Even though this module is a child of the slot child-module. Hence the update to Microsoft.Web/sites/slots/extensions. Let me know what you think and if this was on purpose.

For the other folders it seems correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good Find. @tsc-buddy Any insights on this? This cannot be intentional ?

@AlexanderSehr AlexanderSehr requested a review from a team as a code owner May 5, 2025 13:49
AlexanderSehr added a commit that referenced this pull request May 5, 2025
…5147)

## Description

The function may now return `Diagnostic` information that is considere a
warning. However, because the current implementation treats **any**
return value as an error, these warnings are blocking.
The updated implementation differentiates the two by only throwing an
error if the return value contains a `code`.

This PR is a dependency for
#5083 as that PR
does return diagnostic warnings (false positives) and cannot get past
the `Test-AzDeployment` stage without the fix

### Example output

```pwsh
PS C:\dev> $res = Test-AzSubscriptionDeployment @DeploymentInputs -Location $DeploymentMetadataLocation
# Using Bicep v0.35.1
# Calling Bicep with arguments: build "C:\dev\avm\res\web\site\tests\e2e\webAppLinux.max\main.test.bicep" --stdout
# C:\dev\avm\res\web\site\main.bicep(545,25) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: secure value 'slots[*].siteConfig.azureStorageAccounts.*.accessKey' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets]

# 14:16:04 - Template is valid.

# Diagnostics (2):
# (/subscriptions/<subId>/resourceGroups/dep-avmx-web.sites-wswalmax-rg/providers/Microsoft.Resources/deployments/x5ei2emr6nll2-test-wswalmax-init) A nested deployment got short-circuited and all its resources got skipped from validation. This is due to a nested template having a parameter that was not fully evaluated (e.g. contains a reference() function). Please see https://aka.ms/WhatIfEvalStopped for more guidance. (NestedDeploymentShortCircuited)
# (/subscriptions/<subId>resourceGroups/dep-avmx-web.sites-wswalmax-rg/providers/Microsoft.Resources/deployments/x5ei2emr6nll2-test-wswalmax-idem) A nested deployment got short-circuited and all its resources got skipped from validation. This is due to a nested template having a parameter that was not fully evaluated (e.g. contains a reference() function). Please see https://aka.ms/WhatIfEvalStopped for more guidance. (NestedDeploymentShortCircuited)

$res

# Diagnostics (2):
# (/subscriptions/<subId>/resourceGroups/dep-avmx-web.sites-wswalmax-rg/providers/Microsoft.Resources/deployments/x5ei2emr6nll2-test-wswalmax-init) A nested deployment got short-circuited and all its resources got skipped from validation. This is due to a nested template having a parameter that was not fully evaluated (e.g. contains a reference() function). Please see https://aka.ms/WhatIfEvalStopped for more guidance. (NestedDeploymentShortCircuited)
# (/subscriptions/<subId>resourceGroups/dep-avmx-web.sites-wswalmax-rg/providers/Microsoft.Resources/deployments/x5ei2emr6nll2-test-wswalmax-idem) A nested deployment got short-circuited and all its resources got skipped from validation. This is due to a nested template having a parameter that was not fully evaluated (e.g. contains a reference() function). Please see https://aka.ms/WhatIfEvalStopped for more guidance. (NestedDeploymentShortCircuited)
```

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.key-vault.vault](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2FdiagnosticsDuringTestAz&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [x] 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
@AlexanderSehr AlexanderSehr marked this pull request as draft May 5, 2025 13:56
@AlexanderSehr AlexanderSehr marked this pull request as ready for review May 5, 2025 13:57
@AlexanderSehr AlexanderSehr removed request for a team May 5, 2025 13:58
@AlexanderSehr AlexanderSehr added Needs: Module Owner 📣 This module needs an owner to develop or maintain it and removed Needs: Core Team 🧞 This item needs the AVM Core Team to review it labels May 5, 2025
Copy link
Contributor

@pankajagrawal16 pankajagrawal16 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Needs: Module Owner 📣 This module needs an owner to develop or maintain it Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
2 participants