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

New Resource r/azurerm.function_app_slot #6435

Merged
merged 6 commits into from
May 6, 2020

Conversation

aristosvo
Copy link
Collaborator

Fixes #1307.

I'll move in a bit more, but started with the basics.

@aristosvo aristosvo force-pushed the functionslot branch 2 times, most recently from 848ec44 to 06c4b4d Compare April 10, 2020 20:41
@ghost ghost added size/XXL and removed size/XL labels Apr 10, 2020
@aristosvo aristosvo force-pushed the functionslot branch 2 times, most recently from 292c0c1 to 293f029 Compare April 10, 2020 23:10
@aristosvo aristosvo marked this pull request as ready for review April 10, 2020 23:12
@aristosvo
Copy link
Collaborator Author

aristosvo commented Apr 10, 2020

It's almost complete, I've a few acc tests still failing.

Update: acctests are fixed! Improvements and extension of the acceptance tests are welcome, as I'm not exactly a functional user of Function App deployments slots. For now I've copied the tests mostly from App Service deployment slots, dropped a few and replaced a few for Function App tests.

==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test -v ./azurerm/internal/services/web/tests/ -run=TestAccAzureRMFunctionAppSlot -timeout 60m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMFunctionAppSlot_basic
=== PAUSE TestAccAzureRMFunctionAppSlot_basic
=== RUN   TestAccAzureRMFunctionAppSlot_requiresImport
=== PAUSE TestAccAzureRMFunctionAppSlot_requiresImport
=== RUN   TestAccAzureRMFunctionAppSlot_32Bit
=== PAUSE TestAccAzureRMFunctionAppSlot_32Bit
=== RUN   TestAccAzureRMFunctionAppSlot_alwaysOn
=== PAUSE TestAccAzureRMFunctionAppSlot_alwaysOn
=== RUN   TestAccAzureRMFunctionAppSlot_appSettings
=== PAUSE TestAccAzureRMFunctionAppSlot_appSettings
=== RUN   TestAccAzureRMFunctionAppSlot_clientAffinityEnabled
=== PAUSE TestAccAzureRMFunctionAppSlot_clientAffinityEnabled
=== RUN   TestAccAzureRMFunctionAppSlot_clientAffinityEnabledUpdate
=== PAUSE TestAccAzureRMFunctionAppSlot_clientAffinityEnabledUpdate
=== RUN   TestAccAzureRMFunctionAppSlot_connectionStrings
=== PAUSE TestAccAzureRMFunctionAppSlot_connectionStrings
=== RUN   TestAccAzureRMFunctionAppSlot_corsSettings
=== PAUSE TestAccAzureRMFunctionAppSlot_corsSettings
=== RUN   TestAccAzureRMFunctionAppSlot_authSettings
=== PAUSE TestAccAzureRMFunctionAppSlot_authSettings
=== RUN   TestAccAzureRMFunctionAppSlot_enabled
=== PAUSE TestAccAzureRMFunctionAppSlot_enabled
=== RUN   TestAccAzureRMFunctionAppSlot_enabledUpdate
=== PAUSE TestAccAzureRMFunctionAppSlot_enabledUpdate
=== RUN   TestAccAzureRMFunctionAppSlot_httpsOnly
=== PAUSE TestAccAzureRMFunctionAppSlot_httpsOnly
=== RUN   TestAccAzureRMFunctionAppSlot_httpsOnlyUpdate
=== PAUSE TestAccAzureRMFunctionAppSlot_httpsOnlyUpdate
=== RUN   TestAccAzureRMFunctionAppSlot_http2Enabled
=== PAUSE TestAccAzureRMFunctionAppSlot_http2Enabled
=== RUN   TestAccAzureRMFunctionAppSlot_oneIpRestriction
=== PAUSE TestAccAzureRMFunctionAppSlot_oneIpRestriction
=== RUN   TestAccAzureRMFunctionAppSlot_oneVNetSubnetIpRestriction
=== PAUSE TestAccAzureRMFunctionAppSlot_oneVNetSubnetIpRestriction
=== RUN   TestAccAzureRMFunctionAppSlot_zeroedIpRestriction
=== PAUSE TestAccAzureRMFunctionAppSlot_zeroedIpRestriction
=== RUN   TestAccAzureRMFunctionAppSlot_manyIpRestrictions
=== PAUSE TestAccAzureRMFunctionAppSlot_manyIpRestrictions
=== RUN   TestAccAzureRMFunctionAppSlot_tagsUpdate
=== PAUSE TestAccAzureRMFunctionAppSlot_tagsUpdate
=== RUN   TestAccAzureRMFunctionAppSlot_updateManageServiceIdentity
=== PAUSE TestAccAzureRMFunctionAppSlot_updateManageServiceIdentity
=== RUN   TestAccAzureRMFunctionAppSlot_userAssignedIdentity
=== PAUSE TestAccAzureRMFunctionAppSlot_userAssignedIdentity
=== RUN   TestAccAzureRMFunctionAppSlot_webSockets
=== PAUSE TestAccAzureRMFunctionAppSlot_webSockets
=== RUN   TestAccAzureRMFunctionAppSlot_enableManageServiceIdentity
=== PAUSE TestAccAzureRMFunctionAppSlot_enableManageServiceIdentity
=== RUN   TestAccAzureRMFunctionAppSlot_minTls
=== PAUSE TestAccAzureRMFunctionAppSlot_minTls
=== CONT  TestAccAzureRMFunctionAppSlot_basic
=== CONT  TestAccAzureRMFunctionAppSlot_httpsOnlyUpdate
=== CONT  TestAccAzureRMFunctionAppSlot_updateManageServiceIdentity
=== CONT  TestAccAzureRMFunctionAppSlot_enableManageServiceIdentity
--- PASS: TestAccAzureRMFunctionAppSlot_enableManageServiceIdentity (278.00s)
=== CONT  TestAccAzureRMFunctionAppSlot_webSockets
--- PASS: TestAccAzureRMFunctionAppSlot_basic (278.03s)
=== CONT  TestAccAzureRMFunctionAppSlot_userAssignedIdentity
--- PASS: TestAccAzureRMFunctionAppSlot_httpsOnlyUpdate (366.91s)
=== CONT  TestAccAzureRMFunctionAppSlot_zeroedIpRestriction
--- PASS: TestAccAzureRMFunctionAppSlot_updateManageServiceIdentity (383.02s)
=== CONT  TestAccAzureRMFunctionAppSlot_tagsUpdate
--- PASS: TestAccAzureRMFunctionAppSlot_userAssignedIdentity (292.05s)
=== CONT  TestAccAzureRMFunctionAppSlot_manyIpRestrictions
--- PASS: TestAccAzureRMFunctionAppSlot_webSockets (300.17s)
=== CONT  TestAccAzureRMFunctionAppSlot_connectionStrings
--- PASS: TestAccAzureRMFunctionAppSlot_tagsUpdate (416.50s)
=== CONT  TestAccAzureRMFunctionAppSlot_httpsOnly
--- PASS: TestAccAzureRMFunctionAppSlot_manyIpRestrictions (300.72s)
=== CONT  TestAccAzureRMFunctionAppSlot_enabledUpdate
--- PASS: TestAccAzureRMFunctionAppSlot_zeroedIpRestriction (522.49s)
=== CONT  TestAccAzureRMFunctionAppSlot_enabled
--- PASS: TestAccAzureRMFunctionAppSlot_connectionStrings (376.54s)
=== CONT  TestAccAzureRMFunctionAppSlot_authSettings
--- PASS: TestAccAzureRMFunctionAppSlot_httpsOnly (274.03s)
=== CONT  TestAccAzureRMFunctionAppSlot_corsSettings
--- PASS: TestAccAzureRMFunctionAppSlot_enabled (287.84s)
=== CONT  TestAccAzureRMFunctionAppSlot_minTls
--- PASS: TestAccAzureRMFunctionAppSlot_enabledUpdate (397.19s)
=== CONT  TestAccAzureRMFunctionAppSlot_oneIpRestriction
--- PASS: TestAccAzureRMFunctionAppSlot_authSettings (313.97s)
=== CONT  TestAccAzureRMFunctionAppSlot_oneVNetSubnetIpRestriction
--- PASS: TestAccAzureRMFunctionAppSlot_corsSettings (330.19s)
=== CONT  TestAccAzureRMFunctionAppSlot_http2Enabled
--- PASS: TestAccAzureRMFunctionAppSlot_oneIpRestriction (302.54s)
=== CONT  TestAccAzureRMFunctionAppSlot_clientAffinityEnabledUpdate
--- PASS: TestAccAzureRMFunctionAppSlot_oneVNetSubnetIpRestriction (322.47s)
=== CONT  TestAccAzureRMFunctionAppSlot_appSettings
--- PASS: TestAccAzureRMFunctionAppSlot_minTls (413.97s)
=== CONT  TestAccAzureRMFunctionAppSlot_32Bit
--- PASS: TestAccAzureRMFunctionAppSlot_http2Enabled (287.12s)
=== CONT  TestAccAzureRMFunctionAppSlot_alwaysOn
--- PASS: TestAccAzureRMFunctionAppSlot_32Bit (294.23s)
=== CONT  TestAccAzureRMFunctionAppSlot_clientAffinityEnabled
--- PASS: TestAccAzureRMFunctionAppSlot_appSettings (311.83s)
=== CONT  TestAccAzureRMFunctionAppSlot_requiresImport
--- PASS: TestAccAzureRMFunctionAppSlot_clientAffinityEnabledUpdate (397.34s)
--- PASS: TestAccAzureRMFunctionAppSlot_alwaysOn (307.45s)
--- PASS: TestAccAzureRMFunctionAppSlot_clientAffinityEnabled (263.30s)
--- PASS: TestAccAzureRMFunctionAppSlot_requiresImport (329.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/tests	2232.193s

Update

--- PASS: TestAccAzureRMFunctionAppSlot_updateVersion (380.91s)
--- PASS: TestAccAzureRMFunctionAppSlot_preWarmedInstanceCount (438.69s)

@aristosvo aristosvo force-pushed the functionslot branch 5 times, most recently from f5047d0 to 4665b59 Compare April 11, 2020 12:40
@schlbra
Copy link

schlbra commented Apr 20, 2020

Can this be merged in and added to the next release!? @francescopersico

@schlbra
Copy link

schlbra commented Apr 26, 2020

This is place 4 in the most wanted features of The Azure TerraForm provider and it appears this PR is ready to be merged. I am sure the size of the PR is a factor but can it be merged? @tombuildsstuff

@jackofallops jackofallops self-assigned this May 1, 2020
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @aristosvo

Thanks for the PR for the new resource. I've commented and requested changes below. I realise that a lot of the schema comments are because you've used the azurerm_function_app as a basis for this resource a brought a lot of the schema over, but as it's a new resource we'd try to bring the good practices learned elsewhere in the provider along too. (The service has also changed a lot since being added to the provider)

There's a blocking change that will require your branch rebasing against master as there's a reliance on a function in the function_app resource which has changed (noted below).

Other than this, it's looking good. If you can address these, I'll loop back around asap and re-review

Thanks!

Ste

@aristosvo aristosvo force-pushed the functionslot branch 2 times, most recently from 968f387 to c3b5c28 Compare May 1, 2020 17:26
@katbyte katbyte added this to the v2.9.0 milestone May 1, 2020
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @aristosvo
Thanks for the updates. I discovered a bug in master that would prevent us testing this PR for merge. This has now been fixed, so I've had another quick run through this and there's a couple more things I've spotted, noted below. You should probably rebase against master to pick up the fix I mentioned too if that's OK?

Thanks again,

Ste

Aris van Ommeren added 2 commits May 5, 2020 16:44
@aristosvo
Copy link
Collaborator Author

aristosvo commented May 5, 2020

I'll run the acctests once again and add pre_warmed_instance_count + tests for that after that to complete the implementation.

I hope to finish that tonight, otherwise tomorrow night.

Edit: Done

--- PASS: TestAccAzureRMFunctionAppSlot_preWarmedInstanceCount (438.69s)

@ghost ghost removed the waiting-response label May 5, 2020
@jackofallops
Copy link
Member

Tests Pass:
image

(Tested FunctionApp also as touched my this PR)

2 failing tests are for FunctionApp and are present in master branch

@jackofallops jackofallops merged commit e0397cd into hashicorp:master May 6, 2020
jackofallops added a commit that referenced this pull request May 6, 2020
@schlbra
Copy link

schlbra commented May 7, 2020

Thank you all! We can't wait to start using this!

@ghost
Copy link

ghost commented May 8, 2020

This has been released in version 2.9.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.9.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 5, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 5, 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.

New Resource: azurerm_function_app_slot
6 participants