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 website publishing cred policy #4202

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions modules/web/site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ module site 'br:bicep/modules/web.site:1.0.0' = {
runtimeVersion: '~1'
}
}
basicPublishingCredentialsPolicies: [
{
allow: false
name: 'ftp'
}
{
allow: false
name: 'scm'
}
]
diagnosticSettings: [
{
eventHubAuthorizationRuleResourceId: '<eventHubAuthorizationRuleResourceId>'
Expand Down Expand Up @@ -285,6 +295,18 @@ module site 'br:bicep/modules/web.site:1.0.0' = {
}
}
},
"basicPublishingCredentialsPolicies": {
"value": [
{
"allow": false,
"name": "ftp"
},
{
"allow": false,
"name": "scm"
}
]
},
"diagnosticSettings": {
"value": [
{
Expand Down Expand Up @@ -450,9 +472,11 @@ module site 'br:bicep/modules/web.site:1.0.0' = {
// Non-required parameters
basicPublishingCredentialsPolicies: [
{
allow: true
name: 'ftp'
}
{
allow: true
name: 'scm'
}
]
Expand Down Expand Up @@ -604,9 +628,11 @@ module site 'br:bicep/modules/web.site:1.0.0' = {
"basicPublishingCredentialsPolicies": {
"value": [
{
"allow": true,
"name": "ftp"
},
{
"allow": true,
"name": "scm"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ This module deploys a Web Site Basic Publishing Credentials Policy.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`allow`](#parameter-allow) | bool | Set to true to allow access to or false to diable a publishing method. |
| [`enableDefaultTelemetry`](#parameter-enabledefaulttelemetry) | bool | Enable telemetry via a Globally Unique Identifier (GUID). |
| [`location`](#parameter-location) | string | Location for all Resources. |

### Parameter: `allow`

Set to true to allow access to or false to diable a publishing method.
- Required: No
- Type: bool
- Default: `True`

### Parameter: `enableDefaultTelemetry`

Enable telemetry via a Globally Unique Identifier (GUID).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata owner = 'Azure/module-maintainers'
])
param name string

@sys.description('Optional. Set to true to allow access to or false to diable a publishing method.')
tyconsulting marked this conversation as resolved.
Show resolved Hide resolved
param allow bool = true

@sys.description('Conditional. The name of the parent web site. Required if the template is used in a standalone deployment.')
param webAppName string

Expand Down Expand Up @@ -39,7 +42,7 @@ resource basicPublishingCredentialsPolicy 'Microsoft.Web/sites/basicPublishingCr
location: location
parent: webApp
properties: {
allow: true
allow: allow
}
}

Expand Down
13 changes: 10 additions & 3 deletions modules/web/site/basic-publishing-credentials-policy/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "5305729672150633375"
"version": "0.23.1.45101",
"templateHash": "12265634131995953652"
},
"name": "Web Site Basic Publishing Credentials Policies",
"description": "This module deploys a Web Site Basic Publishing Credentials Policy.",
Expand All @@ -22,6 +22,13 @@
"description": "Required. The name of the resource."
}
},
"allow": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Set to true to allow access to or false to diable a publishing method."
}
},
"webAppName": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -64,7 +71,7 @@
"name": "[format('{0}/{1}', parameters('webAppName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": {
"allow": true
"allow": "[parameters('allow')]"
}
}
],
Expand Down
61 changes: 34 additions & 27 deletions modules/web/site/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "3962832552855663187"
"version": "0.23.1.45101",
"templateHash": "18196957481129520546"
},
"name": "Web/Function Apps",
"description": "This module deploys a Web or Function App.",
Expand Down Expand Up @@ -884,8 +884,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "12140652943143922490"
"version": "0.23.1.45101",
"templateHash": "12410494471478708764"
},
"name": "Site App Settings",
"description": "This module deploys a Site App Setting.",
Expand Down Expand Up @@ -1029,8 +1029,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "1120403064106188130"
"version": "0.23.1.45101",
"templateHash": "15667145082226037238"
},
"name": "Site Auth Settings V2 Config",
"description": "This module deploys a Site Auth Settings V2 Configuration.",
Expand Down Expand Up @@ -1204,8 +1204,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "842322474793993092"
"version": "0.23.1.45101",
"templateHash": "17728495950787678705"
},
"name": "Web/Function App Deployment Slots",
"description": "This module deploys a Web or Function App Deployment Slot.",
Expand Down Expand Up @@ -2080,8 +2080,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "13223616826795830599"
"version": "0.23.1.45101",
"templateHash": "10562313393461278954"
},
"name": "Site Slot App Settings",
"description": "This module deploys a Site Slot App Setting.",
Expand Down Expand Up @@ -2235,8 +2235,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "16157844933162881953"
"version": "0.23.1.45101",
"templateHash": "13215271953171449159"
},
"name": "Site Slot Auth Settings V2 Config",
"description": "This module deploys a Site Auth Settings V2 Configuration.",
Expand Down Expand Up @@ -2369,8 +2369,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "11888981629758921842"
"version": "0.23.1.45101",
"templateHash": "299894459930368764"
},
"name": "Web/Function Apps Slot Hybrid Connection Relay",
"description": "This module deploys a Site Slot Hybrid Connection Namespace Relay.",
Expand Down Expand Up @@ -2550,8 +2550,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "12078057657290521609"
"version": "0.23.1.45101",
"templateHash": "6873008238043407177"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
Expand Down Expand Up @@ -2953,8 +2953,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "16391702514342252839"
"version": "0.23.1.45101",
"templateHash": "17578977753131828304"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
Expand Down Expand Up @@ -3168,8 +3168,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "5305729672150633375"
"version": "0.23.1.45101",
"templateHash": "12265634131995953652"
},
"name": "Web Site Basic Publishing Credentials Policies",
"description": "This module deploys a Web Site Basic Publishing Credentials Policy.",
Expand All @@ -3186,6 +3186,13 @@
"description": "Required. The name of the resource."
}
},
"allow": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Set to true to allow access to or false to diable a publishing method."
}
},
"webAppName": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -3228,7 +3235,7 @@
"name": "[format('{0}/{1}', parameters('webAppName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": {
"allow": true
"allow": "[parameters('allow')]"
}
}
],
Expand Down Expand Up @@ -3299,8 +3306,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "10458383238656360850"
"version": "0.23.1.45101",
"templateHash": "14574905385050050440"
},
"name": "Web/Function Apps Hybrid Connection Relay",
"description": "This module deploys a Site Hybrid Connection Namespace Relay.",
Expand Down Expand Up @@ -3473,8 +3480,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "12078057657290521609"
"version": "0.23.1.45101",
"templateHash": "6873008238043407177"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
Expand Down Expand Up @@ -3876,8 +3883,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "16391702514342252839"
"version": "0.23.1.45101",
"templateHash": "17578977753131828304"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
Expand Down
10 changes: 10 additions & 0 deletions modules/web/site/tests/e2e/functionAppCommon/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ module testDeployment '../../../main.bicep' = {
runtimeVersion: '~1'
}
}
basicPublishingCredentialsPolicies: [
{
name: 'ftp'
allow: false
}
{
name: 'scm'
allow: false
}
]
diagnosticSettings: [
{
name: 'customSetting'
Expand Down
2 changes: 2 additions & 0 deletions modules/web/site/tests/e2e/webAppCommon/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ module testDeployment '../../../main.bicep' = {
basicPublishingCredentialsPolicies: [
{
name: 'ftp'
allow: true
}
{
name: 'scm'
allow: true
}

]
Expand Down