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

resource/function_app: Share the site_config schema of app_service #3666

Closed
wants to merge 1 commit into from

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jun 14, 2019

Fixes: #1374

The API and SDK intrinsically links these as the same config block
therefore, we can share the schema and take advantage of all of that
of the app_service site_config block

I added the new documentation to function_app to reflect the changes
based in app_service. Also added a new test to show the enhancement
request this was all to fix - addition of cors_support

▶ acctests azurerm TestAccAzureRMFunctionApp_
=== RUN   TestAccAzureRMFunctionApp_basic
=== PAUSE TestAccAzureRMFunctionApp_basic
=== RUN   TestAccAzureRMFunctionApp_requiresImport
--- SKIP: TestAccAzureRMFunctionApp_requiresImport (0.00s)
    resource_arm_function_app_test.go:49: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMFunctionApp_tags
=== PAUSE TestAccAzureRMFunctionApp_tags
=== RUN   TestAccAzureRMFunctionApp_tagsUpdate
=== PAUSE TestAccAzureRMFunctionApp_tagsUpdate
=== RUN   TestAccAzureRMFunctionApp_appSettings
=== PAUSE TestAccAzureRMFunctionApp_appSettings
=== RUN   TestAccAzureRMFunctionApp_siteConfig
=== PAUSE TestAccAzureRMFunctionApp_siteConfig
=== RUN   TestAccAzureRMFunctionApp_linuxFxVersion
=== PAUSE TestAccAzureRMFunctionApp_linuxFxVersion
=== RUN   TestAccAzureRMFunctionApp_connectionStrings
=== PAUSE TestAccAzureRMFunctionApp_connectionStrings
=== RUN   TestAccAzureRMFunctionApp_siteConfigMulti
=== PAUSE TestAccAzureRMFunctionApp_siteConfigMulti
=== RUN   TestAccAzureRMFunctionApp_updateVersion
=== PAUSE TestAccAzureRMFunctionApp_updateVersion
=== RUN   TestAccAzureRMFunctionApp_3264bit
=== PAUSE TestAccAzureRMFunctionApp_3264bit
=== RUN   TestAccAzureRMFunctionApp_httpsOnly
=== PAUSE TestAccAzureRMFunctionApp_httpsOnly
=== RUN   TestAccAzureRMFunctionApp_consumptionPlan
=== PAUSE TestAccAzureRMFunctionApp_consumptionPlan
=== RUN   TestAccAzureRMFunctionApp_consumptionPlanUppercaseName
=== PAUSE TestAccAzureRMFunctionApp_consumptionPlanUppercaseName
=== RUN   TestAccAzureRMFunctionApp_createIdentity
=== PAUSE TestAccAzureRMFunctionApp_createIdentity
=== RUN   TestAccAzureRMFunctionApp_updateIdentity
=== PAUSE TestAccAzureRMFunctionApp_updateIdentity
=== RUN   TestAccAzureRMFunctionApp_loggingDisabled
=== PAUSE TestAccAzureRMFunctionApp_loggingDisabled
=== RUN   TestAccAzureRMFunctionApp_updateLogging
=== PAUSE TestAccAzureRMFunctionApp_updateLogging
=== RUN   TestAccAzureRMFunctionApp_corsSettings
=== PAUSE TestAccAzureRMFunctionApp_corsSettings
=== CONT  TestAccAzureRMFunctionApp_basic
=== CONT  TestAccAzureRMFunctionApp_3264bit
=== CONT  TestAccAzureRMFunctionApp_linuxFxVersion
=== CONT  TestAccAzureRMFunctionApp_updateVersion
--- PASS: TestAccAzureRMFunctionApp_basic (138.80s)
=== CONT  TestAccAzureRMFunctionApp_siteConfigMulti
--- PASS: TestAccAzureRMFunctionApp_linuxFxVersion (151.18s)
=== CONT  TestAccAzureRMFunctionApp_connectionStrings
--- PASS: TestAccAzureRMFunctionApp_3264bit (174.06s)
=== CONT  TestAccAzureRMFunctionApp_appSettings
--- PASS: TestAccAzureRMFunctionApp_updateVersion (175.55s)
=== CONT  TestAccAzureRMFunctionApp_siteConfig
--- PASS: TestAccAzureRMFunctionApp_connectionStrings (135.78s)
=== CONT  TestAccAzureRMFunctionApp_updateIdentity
--- PASS: TestAccAzureRMFunctionApp_siteConfig (142.55s)
=== CONT  TestAccAzureRMFunctionApp_updateLogging
--- PASS: TestAccAzureRMFunctionApp_appSettings (211.50s)
=== CONT  TestAccAzureRMFunctionApp_loggingDisabled
--- PASS: TestAccAzureRMFunctionApp_updateIdentity (168.26s)
=== CONT  TestAccAzureRMFunctionApp_tags
--- PASS: TestAccAzureRMFunctionApp_siteConfigMulti (354.83s)
=== CONT  TestAccAzureRMFunctionApp_tagsUpdate
--- PASS: TestAccAzureRMFunctionApp_updateLogging (206.62s)
=== CONT  TestAccAzureRMFunctionApp_consumptionPlanUppercaseName
--- PASS: TestAccAzureRMFunctionApp_loggingDisabled (144.01s)
=== CONT  TestAccAzureRMFunctionApp_createIdentity
--- PASS: TestAccAzureRMFunctionApp_tags (136.79s)
=== CONT  TestAccAzureRMFunctionApp_consumptionPlan
--- PASS: TestAccAzureRMFunctionApp_consumptionPlanUppercaseName (165.62s)
=== CONT  TestAccAzureRMFunctionApp_httpsOnly
--- PASS: TestAccAzureRMFunctionApp_createIdentity (165.89s)
--- PASS: TestAccAzureRMFunctionApp_tagsUpdate (205.60s)
--- PASS: TestAccAzureRMFunctionApp_consumptionPlan (172.33s)
--- PASS: TestAccAzureRMFunctionApp_httpsOnly (126.97s)
=== CONT  TestAccAzureRMFunctionApp_corsSettings
--- PASS: TestAccAzureRMFunctionApp_corsSettings (138.49s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	817.367s

The API and SDK intrinsicly links these as the *same* config block
therefore, we can share the schema and take advantage of all of that
of the app_service site_config block

I added the new documentation to function_app to reflect the changes
based in app_service. Also added a new test to show the enhancement
request this was all to fix - addition of cors_support

```
▶ acctests azurerm TestAccAzureRMFunctionApp_
=== RUN   TestAccAzureRMFunctionApp_basic
=== PAUSE TestAccAzureRMFunctionApp_basic
=== RUN   TestAccAzureRMFunctionApp_requiresImport
--- SKIP: TestAccAzureRMFunctionApp_requiresImport (0.00s)
    resource_arm_function_app_test.go:49: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMFunctionApp_tags
=== PAUSE TestAccAzureRMFunctionApp_tags
=== RUN   TestAccAzureRMFunctionApp_tagsUpdate
=== PAUSE TestAccAzureRMFunctionApp_tagsUpdate
=== RUN   TestAccAzureRMFunctionApp_appSettings
=== PAUSE TestAccAzureRMFunctionApp_appSettings
=== RUN   TestAccAzureRMFunctionApp_siteConfig
=== PAUSE TestAccAzureRMFunctionApp_siteConfig
=== RUN   TestAccAzureRMFunctionApp_linuxFxVersion
=== PAUSE TestAccAzureRMFunctionApp_linuxFxVersion
=== RUN   TestAccAzureRMFunctionApp_connectionStrings
=== PAUSE TestAccAzureRMFunctionApp_connectionStrings
=== RUN   TestAccAzureRMFunctionApp_siteConfigMulti
=== PAUSE TestAccAzureRMFunctionApp_siteConfigMulti
=== RUN   TestAccAzureRMFunctionApp_updateVersion
=== PAUSE TestAccAzureRMFunctionApp_updateVersion
=== RUN   TestAccAzureRMFunctionApp_3264bit
=== PAUSE TestAccAzureRMFunctionApp_3264bit
=== RUN   TestAccAzureRMFunctionApp_httpsOnly
=== PAUSE TestAccAzureRMFunctionApp_httpsOnly
=== RUN   TestAccAzureRMFunctionApp_consumptionPlan
=== PAUSE TestAccAzureRMFunctionApp_consumptionPlan
=== RUN   TestAccAzureRMFunctionApp_consumptionPlanUppercaseName
=== PAUSE TestAccAzureRMFunctionApp_consumptionPlanUppercaseName
=== RUN   TestAccAzureRMFunctionApp_createIdentity
=== PAUSE TestAccAzureRMFunctionApp_createIdentity
=== RUN   TestAccAzureRMFunctionApp_updateIdentity
=== PAUSE TestAccAzureRMFunctionApp_updateIdentity
=== RUN   TestAccAzureRMFunctionApp_loggingDisabled
=== PAUSE TestAccAzureRMFunctionApp_loggingDisabled
=== RUN   TestAccAzureRMFunctionApp_updateLogging
=== PAUSE TestAccAzureRMFunctionApp_updateLogging
=== RUN   TestAccAzureRMFunctionApp_corsSettings
=== PAUSE TestAccAzureRMFunctionApp_corsSettings
=== CONT  TestAccAzureRMFunctionApp_basic
=== CONT  TestAccAzureRMFunctionApp_3264bit
=== CONT  TestAccAzureRMFunctionApp_linuxFxVersion
=== CONT  TestAccAzureRMFunctionApp_updateVersion
--- PASS: TestAccAzureRMFunctionApp_basic (138.80s)
=== CONT  TestAccAzureRMFunctionApp_siteConfigMulti
--- PASS: TestAccAzureRMFunctionApp_linuxFxVersion (151.18s)
=== CONT  TestAccAzureRMFunctionApp_connectionStrings
--- PASS: TestAccAzureRMFunctionApp_3264bit (174.06s)
=== CONT  TestAccAzureRMFunctionApp_appSettings
--- PASS: TestAccAzureRMFunctionApp_updateVersion (175.55s)
=== CONT  TestAccAzureRMFunctionApp_siteConfig
--- PASS: TestAccAzureRMFunctionApp_connectionStrings (135.78s)
=== CONT  TestAccAzureRMFunctionApp_updateIdentity
--- PASS: TestAccAzureRMFunctionApp_siteConfig (142.55s)
=== CONT  TestAccAzureRMFunctionApp_updateLogging
--- PASS: TestAccAzureRMFunctionApp_appSettings (211.50s)
=== CONT  TestAccAzureRMFunctionApp_loggingDisabled
--- PASS: TestAccAzureRMFunctionApp_updateIdentity (168.26s)
=== CONT  TestAccAzureRMFunctionApp_tags
--- PASS: TestAccAzureRMFunctionApp_siteConfigMulti (354.83s)
=== CONT  TestAccAzureRMFunctionApp_tagsUpdate
--- PASS: TestAccAzureRMFunctionApp_updateLogging (206.62s)
=== CONT  TestAccAzureRMFunctionApp_consumptionPlanUppercaseName
--- PASS: TestAccAzureRMFunctionApp_loggingDisabled (144.01s)
=== CONT  TestAccAzureRMFunctionApp_createIdentity
--- PASS: TestAccAzureRMFunctionApp_tags (136.79s)
=== CONT  TestAccAzureRMFunctionApp_consumptionPlan
--- PASS: TestAccAzureRMFunctionApp_consumptionPlanUppercaseName (165.62s)
=== CONT  TestAccAzureRMFunctionApp_httpsOnly
--- PASS: TestAccAzureRMFunctionApp_createIdentity (165.89s)
--- PASS: TestAccAzureRMFunctionApp_tagsUpdate (205.60s)
--- PASS: TestAccAzureRMFunctionApp_consumptionPlan (172.33s)
--- PASS: TestAccAzureRMFunctionApp_httpsOnly (126.97s)
=== CONT  TestAccAzureRMFunctionApp_corsSettings
--- PASS: TestAccAzureRMFunctionApp_corsSettings (138.49s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	817.367s
```
@stack72
Copy link
Contributor Author

stack72 commented Jun 14, 2019

After speaking with @tombuildsstuff offline about this, we can't take this approach. Even though the SDK uses the same models under the hood, the API accept different versions of the parameters. So the reuse of the same swagger to generate the SDK feels stupid IMO

@stack72 stack72 closed this Jun 14, 2019
@ghost
Copy link

ghost commented Jul 15, 2019

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 15, 2019
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.

CORS settings for function app
1 participant