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

App Service Custom Hostname Binding: support for multiple bindings #1970

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

tombuildsstuff
Copy link
Contributor

@tombuildsstuff tombuildsstuff commented Sep 23, 2018

The Azure API only allows a single hostname to be added/removed at once. This PR adds a lock to ensure this is the case

before this change:

$ ARM_TEST_APP_SERVICE=tomdevacctest12345 ARM_TEST_DOMAIN=REDACTED ARM_ALT_TEST_DOMAIN=REDACTED acctests azurerm TestAccAzureRMAppServiceCustomHostnameBinding

=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding/basic
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding/basic/basic
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding/basic/import
--- PASS: TestAccAzureRMAppServiceCustomHostnameBinding (299.70s)
    --- PASS: TestAccAzureRMAppServiceCustomHostnameBinding/basic (299.70s)
        --- PASS: TestAccAzureRMAppServiceCustomHostnameBinding/basic/basic (135.97s)
        --- PASS: TestAccAzureRMAppServiceCustomHostnameBinding/basic/import (163.72s)
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding_multiple
--- FAIL: TestAccAzureRMAppServiceCustomHostnameBinding_multiple (112.01s)
	testing.go:573: Error destroying resource! WARNING: Dangling resources
		may exist. The full state and error is shown below.

		Error: Error applying: 1 error(s) occurred:

		* azurerm_app_service_custom_hostname_binding.test2 (destroy): 1 error(s) occurred:

		* azurerm_app_service_custom_hostname_binding.test2: web.AppsClient#DeleteHostNameBinding: Failure sending request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>

after this change:

$ ARM_TEST_APP_SERVICE=tomdevacctest12345 ARM_TEST_DOMAIN=REDACTED ARM_ALT_TEST_DOMAIN=REDACTED acctests azurerm TestAccAzureRMAppServiceCustomHostnameBinding_multiple
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding_multiple
--- PASS: TestAccAzureRMAppServiceCustomHostnameBinding_multiple (157.72s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	158.148s

Fixes #1968

before this change:

```
$ ARM_TEST_APP_SERVICE=tomdevacctest12345 ARM_TEST_DOMAIN=REDACTED ARM_ALT_TEST_DOMAIN=REDACTED acctests azurerm TestAccAzureRMAppServiceCustomHostnameBinding

=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding/basic
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding/basic/basic
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding/basic/import
--- PASS: TestAccAzureRMAppServiceCustomHostnameBinding (299.70s)
    --- PASS: TestAccAzureRMAppServiceCustomHostnameBinding/basic (299.70s)
        --- PASS: TestAccAzureRMAppServiceCustomHostnameBinding/basic/basic (135.97s)
        --- PASS: TestAccAzureRMAppServiceCustomHostnameBinding/basic/import (163.72s)
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding_multiple
--- FAIL: TestAccAzureRMAppServiceCustomHostnameBinding_multiple (112.01s)
	testing.go:573: Error destroying resource! WARNING: Dangling resources
		may exist. The full state and error is shown below.

		Error: Error applying: 1 error(s) occurred:

		* azurerm_app_service_custom_hostname_binding.test2 (destroy): 1 error(s) occurred:

		* azurerm_app_service_custom_hostname_binding.test2: web.AppsClient#DeleteHostNameBinding: Failure sending request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>
```

after this change:

```
$ ARM_TEST_APP_SERVICE=tomdevacctest12345 ARM_TEST_DOMAIN=REDACTED ARM_ALT_TEST_DOMAIN=REDACTED acctests azurerm TestAccAzureRMAppServiceCustomHostnameBinding_multiple
=== RUN   TestAccAzureRMAppServiceCustomHostnameBinding_multiple
--- PASS: TestAccAzureRMAppServiceCustomHostnameBinding_multiple (157.72s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	158.148s
```
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

LGTM

@tombuildsstuff tombuildsstuff merged commit df50acd into master Sep 25, 2018
@tombuildsstuff tombuildsstuff deleted the b/app-service/multiple-domains branch September 25, 2018 22:19
tombuildsstuff added a commit that referenced this pull request Sep 25, 2018
@ghost
Copy link

ghost commented Mar 6, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

2 participants