Skip to content

Commit

Permalink
fix: WAF reliability and static validation in avm/res/web/site (#1427)
Browse files Browse the repository at this point in the history
## Description

- added PSRule exceptions for `defaults` tests
- removed optional parameters from `defaults` tests
- re-generated readme due to static validation errors

fixes #1378 
fixes #1510 
fixes #1592 

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.web.site](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.web.site.yml/badge.svg?branch=users%2Fkrbar%2FwebSiteFix)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.web.site.yml)
|

## Type of Change

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

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [x] Azure Verified Module updates:
- [x] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [x] 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

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

<!-- Please keep up to day with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
krbar authored Apr 17, 2024
1 parent 46d965b commit 025b862
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 33 deletions.
24 changes: 6 additions & 18 deletions avm/res/web/site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ module site 'br/public:avm/res/web/site:<version>' = {
serverFarmResourceId: '<serverFarmResourceId>'
// Non-required parameters
location: '<location>'
siteConfig: {
alwaysOn: true
}
}
}
```
Expand Down Expand Up @@ -97,11 +94,6 @@ module site 'br/public:avm/res/web/site:<version>' = {
// Non-required parameters
"location": {
"value": "<location>"
},
"siteConfig": {
"value": {
"alwaysOn": true
}
}
}
}
Expand Down Expand Up @@ -659,10 +651,6 @@ module site 'br/public:avm/res/web/site:<version>' = {
serverFarmResourceId: '<serverFarmResourceId>'
// Non-required parameters
location: '<location>'
siteConfig: {
alwaysOn: true
healthCheckPath: '/healthz'
}
}
}
```
Expand Down Expand Up @@ -692,12 +680,6 @@ module site 'br/public:avm/res/web/site:<version>' = {
// Non-required parameters
"location": {
"value": "<location>"
},
"siteConfig": {
"value": {
"alwaysOn": true,
"healthCheckPath": "/healthz"
}
}
}
}
Expand Down Expand Up @@ -2576,6 +2558,12 @@ The site config object.

- Required: No
- Type: object
- Default:
```Bicep
{
alwaysOn: true
}
```

### Parameter: `slots`

Expand Down
4 changes: 3 additions & 1 deletion avm/res/web/site/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ param vnetRouteAllEnabled bool = false
param scmSiteAlsoStopped bool = false

@description('Optional. The site config object.')
param siteConfig object?
param siteConfig object = {
alwaysOn: true
}

@description('Optional. Required if app of kind functionapp. Resource ID of the storage account to manage triggers and logging function executions.')
param storageAccountResourceId string?
Expand Down
12 changes: 8 additions & 4 deletions avm/res/web/site/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "6312828584864471342"
"templateHash": "14301920664802681394"
},
"name": "Web/Function Apps",
"description": "This module deploys a Web or Function App.",
Expand Down Expand Up @@ -543,7 +543,9 @@
},
"siteConfig": {
"type": "object",
"nullable": true,
"defaultValue": {
"alwaysOn": true
},
"metadata": {
"description": "Optional. The site config object."
}
Expand Down Expand Up @@ -1299,7 +1301,7 @@
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "12157473410186645235"
"templateHash": "7436278786647572492"
},
"name": "Web/Function App Deployment Slots",
"description": "This module deploys a Web or Function App Deployment Slot.",
Expand Down Expand Up @@ -1815,7 +1817,9 @@
},
"siteConfig": {
"type": "object",
"nullable": true,
"defaultValue": {
"alwaysOn": true
},
"metadata": {
"description": "Optional. The site config object."
}
Expand Down
6 changes: 6 additions & 0 deletions avm/res/web/site/slot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,12 @@ The site config object.

- Required: No
- Type: object
- Default:
```Bicep
{
alwaysOn: true
}
```

### Parameter: `storageAccountRequired`

Expand Down
4 changes: 3 additions & 1 deletion avm/res/web/site/slot/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ param storageAccountRequired bool = false
param virtualNetworkSubnetId string?

@description('Optional. The site config object.')
param siteConfig object?
param siteConfig object = {
alwaysOn: true
}

@description('Optional. Required if app of kind functionapp. Resource ID of the storage account to manage triggers and logging function executions.')
param storageAccountResourceId string?
Expand Down
6 changes: 4 additions & 2 deletions avm/res/web/site/slot/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "12157473410186645235"
"templateHash": "7436278786647572492"
},
"name": "Web/Function App Deployment Slots",
"description": "This module deploys a Web or Function App Deployment Slot.",
Expand Down Expand Up @@ -522,7 +522,9 @@
},
"siteConfig": {
"type": "object",
"nullable": true,
"defaultValue": {
"alwaysOn": true
},
"metadata": {
"description": "Optional. The site config object."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ module testDeployment '../../../main.bicep' = [
location: resourceLocation
kind: 'functionapp'
serverFarmResourceId: nestedDependencies.outputs.serverFarmResourceId
siteConfig: {
alwaysOn: true
}
}
dependsOn: [
nestedDependencies
Expand Down
4 changes: 0 additions & 4 deletions avm/res/web/site/tests/e2e/webApp.defaults/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ module testDeployment '../../../main.bicep' = [
location: resourceLocation
kind: 'app'
serverFarmResourceId: nestedDependencies.outputs.serverFarmResourceId
siteConfig: {
healthCheckPath: '/healthz'
alwaysOn: true
}
}

dependsOn: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ spec:
# Azure Virtual Machine
- Azure.VM.AMA
- Azure.VM.Standalone
# Azure App Service
- Azure.AppService.WebProbe # Supressed as the probe path is specific to the app
- Azure.AppService.WebProbePath # Supressed as the probe path is specific to the app
if:
name: "."
contains:
Expand Down

0 comments on commit 025b862

Please sign in to comment.