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

azurerm_function_app - add support for the always_on and connection_string fields #695

Merged

Conversation

cloudify
Copy link
Contributor

Hello @tombuildsstuff,

my attempt to fix #691, I've added the always_on attribute for now, if my approach is good for you I'll add the rest,

thanks

@cloudify
Copy link
Contributor Author

I've added also the support for custom connection_string in function_app

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

Hey @cloudify

Thanks for this PR - I've taken a look through and left a couple of comments in-line but this otherwise LGTM :)

Thanks!

@@ -106,6 +159,7 @@ func resourceArmFunctionAppCreate(d *schema.ResourceData, meta interface{}) erro
ServerFarmID: utils.String(appServicePlanID),
Enabled: utils.Bool(enabled),
SiteConfig: &web.SiteConfig{
AlwaysOn: siteConfig.AlwaysOn,
AppSettings: &basicAppSettings,
Copy link
Member

Choose a reason for hiding this comment

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

since this object is actually being returned, rather than mapping each individual object across can we assign the existing AppSettings object to the returned siteConfig object (for instance):

siteConfig := expandFunctionAppSiteConfig(d)
siteConfig.AppSettings = basicAppSettings

# ...

siteEnvelope := web.Site{
  # ...
  Enabled:    utils.Bool(enabled),
  SiteConfig: &siteConfig,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -94,6 +94,52 @@ func TestAccAzureRMFunctionApp_appSettings(t *testing.T) {
})
}

func TestAccAzureRMFunctionApp_siteConfig(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

can we add an additional test to set an app setting, then enable always on (as a separate step) and then add a connection string to have an end-to-end test? Multiple test steps can be achieved by specifying multiple steps below, like so:

Steps: []resource.TestStep{
  {
    Config: config,
    Check: resource.ComposeTestCheckFunc(
      testCheckAzureRMFunctionAppExists(resourceName),
      resource.TestCheckResourceAttr(resourceName, "site_config.0.always_on", "true"),
    ),
  },
  {
    Config: updatedConfig,
    Check: resource.ComposeTestCheckFunc(
      testCheckAzureRMFunctionAppExists(resourceName),
      resource.TestCheckResourceAttr(resourceName, "site_config.0.always_on", "false"),
    ),
  },
},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@cloudify cloudify force-pushed the 691-functionapp-siteconfig branch 2 times, most recently from 817022b to 2780a7d Compare January 23, 2018 08:30
@cloudify
Copy link
Contributor Author

@tombuildsstuff I've fixed the conflict and taken care of your suggestions

@tombuildsstuff
Copy link
Member

Hey @cloudify

Thanks for pushing those updates - apologies for the delayed re-review here, I'm just taking a look into this now.

Thanks!

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @cloudify

Thanks for pushing those updates - I'll kick off the test suite now - but this now LGTM 👍

Thanks!

@tombuildsstuff
Copy link
Member

Tests pass:

screen shot 2018-01-23 at 13 09 54

@tombuildsstuff tombuildsstuff changed the title Issue #691, adds always_on attribute to the function_app resource azurerm_function_app - add support for the always_on and connection_string fields Jan 23, 2018
@tombuildsstuff tombuildsstuff merged commit 2761016 into hashicorp:master Jan 23, 2018
tombuildsstuff added a commit that referenced this pull request Jan 23, 2018
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: add alwaysOn and connectionStrings arguments in azurerm_function_app
2 participants