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

Support for number_of_workers in app_service #10143

Merged
merged 6 commits into from
Jan 23, 2021
Merged

Support for number_of_workers in app_service #10143

merged 6 commits into from
Jan 23, 2021

Conversation

AdamCoulterOz
Copy link
Contributor

Fixes #8555

@AdamCoulterOz
Copy link
Contributor Author

AdamCoulterOz commented Jan 13, 2021

@jackofallops - are you able to take a look at this one for me? I've added tests (both resource and unit tests) and updated the docs.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks for the pr @AdamCoulterOz - but this has caused a bunch of test to fail:

------- Stdout: -------
=== RUN   TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours
=== PAUSE TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours
=== CONT  TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours
    testing.go:684: Step 0 error: errors during apply:
        
        Error: Error updating Configuration for App Service Slot "acctestRG-210113192134430089"/"acctestASSlot-210113192134430089": web.AppsClient#CreateOrUpdateConfigurationSlot: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Number of Web workers must be greater than zero." Details=[{"Message":"Number of Web workers must be greater than zero."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"04004","Message":"Number of Web workers must be greater than zero.","MessageTemplate":"Number of Web workers must be greater than zero.","Parameters":[]}}]
        
          on /opt/teamcity-agent/temp/buildTmp/tf-test826555480/main.tf line 31:
          (source code not available)
        
        
--- FAIL: TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours (205.30s)
FAIL

@AdamCoulterOz
Copy link
Contributor Author

AdamCoulterOz commented Jan 14, 2021

Thanks @katbyte - here is my local test results:

The new acctest for this new optional attribute:

zsh> make acctests SERVICE='web' TESTARGS='-run=TestAccAppService_numberOfWorkers' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./azurerm/internal/services/web/ -run=TestAccAppService_numberOfWorkers -timeout 60m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAppService_numberOfWorkers
=== PAUSE TestAccAppService_numberOfWorkers
=== CONT  TestAccAppService_numberOfWorkers
--- PASS: TestAccAppService_numberOfWorkers (167.39s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web 168.665s

Reproducing the acctest that failed on your side:

zsh> make acctests SERVICE='web' TESTARGS='-run=TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./azurerm/internal/services/web/ -run=TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours -timeout 60m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours
=== PAUSE TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours
=== CONT  TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours
    testing.go:684: Step 0 error: errors during apply:
        
        Error: Error updating Configuration for App Service Slot "acctestRG-210114131146375785"/"acctestASSlot-210114131146375785": 
        web.AppsClient#CreateOrUpdateConfigurationSlot: Failure responding to request: StatusCode=400 -- 
        Original Error: autorest/azure: Service returned an error. 
        Status=400 
        Code="BadRequest" 
        Message="Number of Web workers must be greater than zero." 
        
        on /var/folders/x4/k5117w7s4rj7kqdbg9kxm6680000gp/T/tf-test480117064/main.tf line 31
        
--- FAIL: TestAccAppServiceSlot_authSettingsTokenRefreshExtensionHours (152.62s)
FAIL
FAIL    github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web 153.883s
FAIL
make: *** [acctests] Error 1

I also ran the same failed acctest on master and it passed fine. Can you provide some direction on why an optional field may have broken a different test (which I assume couldn't have referenced that field)? I probably need to set a sane default for it then? But it's not always applicable, and null would be a more appropriate setting for it.

Was there any other acctests that failed?

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 @AdamCoulterOz
Thanks for this, and apologies for the delay in getting to review. I've left a couple comments below that I believe should help resolve the testing issue highlighted, otherwise looks to be fine. I'll loop back after I finish a few other things to check in.

azurerm/internal/services/web/app_service.go Show resolved Hide resolved
azurerm/internal/services/web/app_service.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @AdamCoulterOz - this LGTM 👍

@katbyte katbyte merged commit 570ca5a into hashicorp:master Jan 23, 2021
katbyte added a commit that referenced this pull request Jan 23, 2021
@AdamCoulterOz AdamCoulterOz deleted the 8555-appServiceNumberOfWorkers branch January 23, 2021 12:58
@ghost
Copy link

ghost commented Jan 28, 2021

This has been released in version 2.45.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.45.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Feb 22, 2021

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 as resolved and limited conversation to collaborators Feb 22, 2021
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.

Support number_of_workers in site_config block (azurerm_app_service)
3 participants