-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_windows_function_app
, azurerm_linux_function_app
- adding property website_content_share_over_vnet
#26646
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xiaxyi - Some comments and changes to take a look at below. I think this needs a little re-work, particularly around the tests as both configurable options there are being used for this setting, so it's inconclusive if the new property is behaving / work as expected and will mask any conflicting behaviours with the older app_setting
mechanism of enabling this behaviour?
Can you take a look, and I'll continue review.
Thanks!
@@ -70,6 +70,7 @@ type LinuxFunctionAppModel struct { | |||
PublishingDeployBasicAuthEnabled bool `tfschema:"webdeploy_publish_basic_authentication_enabled"` | |||
PublishingFTPBasicAuthEnabled bool `tfschema:"ftp_publish_basic_authentication_enabled"` | |||
Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` | |||
VnetContentShareEnabled bool `tfschema:"website_content_over_vnet"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following contributor guidelines, this should be:
VnetContentShareEnabled bool `tfschema:"website_content_over_vnet"` | |
VnetContentShareEnabled bool `tfschema:"website_content_over_vnet_enabled"` |
"website_content_over_vnet": { | ||
Type: pluginsdk.TypeBool, | ||
Optional: true, | ||
Default: false, | ||
Description: "Should the app scale enabled when storage account restricted to a virtual network? Defaults to `false`.", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, this should be website_content_over_vnet_enabled
.
I also think the Description
here needs re-wording, I'm not sure I understand what this has to do with app scale?
app_settings = { | ||
WEBSITE_CONTENTOVERVNET = "%s" | ||
WEBSITE_CONTENTSHARE = "shareforfa" | ||
} | ||
|
||
site_config {} | ||
website_content_over_vnet = %t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be setting both of these? If we're promoting this to be a top level attribute we should be excluding it's use in the app_settings
map and managing that on the user's behalf as with the other examples of this behaviour.
@@ -69,6 +69,7 @@ type WindowsFunctionAppModel struct { | |||
ZipDeployFile string `tfschema:"zip_deploy_file"` | |||
PublishingDeployBasicAuthEnabled bool `tfschema:"webdeploy_publish_basic_authentication_enabled"` | |||
PublishingFTPBasicAuthEnabled bool `tfschema:"ftp_publish_basic_authentication_enabled"` | |||
VnetContentShareEnabled bool `tfschema:"website_content_over_vnet"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above:
VnetContentShareEnabled bool `tfschema:"website_content_over_vnet"` | |
VnetContentShareEnabled bool `tfschema:"website_content_over_vnet_enabled"` |
"website_content_over_vnet": { | ||
Type: pluginsdk.TypeBool, | ||
Optional: true, | ||
Default: false, | ||
Description: "Should the app scale enabled when storage account restricted to a virtual network? Defaults to `false`.", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above:
"website_content_over_vnet": { | |
Type: pluginsdk.TypeBool, | |
Optional: true, | |
Default: false, | |
Description: "Should the app scale enabled when storage account restricted to a virtual network? Defaults to `false`.", | |
}, | |
"website_content_over_vnet_enabled": { | |
Type: pluginsdk.TypeBool, | |
Optional: true, | |
Default: false, | |
Description: "Should the app scale enabled when storage account restricted to a virtual network? Defaults to `false`.", | |
}, |
Similarly, can you review the description here, it doesn't make sense to me?
_, contentSharePresent := functionApp.AppSettings["WEBSITE_CONTENTSHARE"] | ||
if _, contentShareConnectionStringPresent := functionApp.AppSettings["WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"]; !contentShareConnectionStringPresent { | ||
functionApp.AppSettings["WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"] = storageString | ||
} | ||
|
||
if !contentSharePresent { | ||
if contentOverVnetEnabled { | ||
if contentOverVnetEnabled || contentOverVnetEnabledSiteSetting { | ||
return fmt.Errorf("the app_setting WEBSITE_CONTENTSHARE must be specified and set to a valid share when WEBSITE_CONTENTOVERVNET is specified") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message needs additional clarification as there will be 2 ways this value can be true?
_, contentSharePresent := functionApp.AppSettings["WEBSITE_CONTENTSHARE"] | ||
if _, contentShareConnectionStringPresent := functionApp.AppSettings["WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"]; !contentShareConnectionStringPresent { | ||
functionApp.AppSettings["WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"] = storageString | ||
} | ||
|
||
if !contentSharePresent { | ||
if contentOverVnetEnabled { | ||
if contentOverVnetEnabled || contentOverVnetEnabledSiteSetting { | ||
return fmt.Errorf("the app_setting WEBSITE_CONTENTSHARE must be specified and set to a valid share when WEBSITE_CONTENTOVERVNET is specified") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, this needs to be clear about the property, not just the app_setting
value.
* `website_content_over_vnet` - Is function app scale enabled when the linked storage account is restricted to a virtual network? Defaults to `false`. | ||
|
||
!> **Note:** This property will replace the `WEBSITE_CONTENTOVERVNET` in `app_setting`. `website_content_over_vnet` is the recommended one despite both settings work currently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description doesn't sound like it matches what the setting does, it doesn't relate to app scale, rather if the storage account is accessed via VNet?
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
azurerm_windows_function_app
, azurerm_linux_function_app
- adding property website_content_over_vnet
azurerm_windows_function_app
, azurerm_linux_function_app
- adding property website_content_share_over_vnet
Community Note
Description
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”azurerm_windows_function_app
,azurerm_linux_function_app
- adding propertywebsite_content_over_vnet
Changes to existing Resource / Data Source
Testing
--- PASS: TestAccWindowsFunctionApp_websiteContentOverVnetUpdate (585.08s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice 603.626s
--- PASS: TestAccLinuxFunctionApp_websiteContentOverVnetUpdate (643.45s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice 648.859s
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_windows_function_app
,azurerm_linux_function_app
- adding propertywebsite_content_over_vnet
This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.