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

Changing an application gateway's subnet fails. #747

Closed
wimpienortje opened this issue Jan 24, 2018 · 5 comments
Closed

Changing an application gateway's subnet fails. #747

wimpienortje opened this issue Jan 24, 2018 · 5 comments
Labels
bug service/application-gateway upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/1.x (legacy)

Comments

@wimpienortje
Copy link

Terraform Version

Terraform v0.11.2

  • provider.azurerm v1.0.1

Affected Resource(s)

azurerm_application_gateway

Terraform Configuration Files

Use the application gateway example from the documentation. Here (https://www.terraform.io/docs/providers/azurerm/r/application_gateway.html#example-usage)

Output

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ azurerm_application_gateway.network
      gateway_ip_configuration.0.subnet_id: "/subscriptions/....../subnets/my-subnet-1" => "/subscriptions/......./subnets/my-subnet-2"


Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azurerm_application_gateway.network: Modifying... (ID: /subscriptions/...nGateways/my-application-gateway-12345)
  gateway_ip_configuration.0.subnet_id: "/subscriptions/......./subnets/my-subnet-1" => "/subscriptions/........./subnets/my-subnet-2"

Error: Error applying plan:

1 error(s) occurred:

* azurerm_application_gateway.network: 1 error(s) occurred:

* azurerm_application_gateway.network: Error Creating/Updating ApplicationGateway network.ApplicationGatewaysClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ApplicationGatewayIpCofigSubnetCannotBeChanged" Message="Subnet referenced by GatewayIpConfiguration /subscriptions/......../providers/Microsoft.Network/applicationGateways/my-application-gateway-12345/gatewayIPConfigurations/my-gateway-ip-configuration cannot be changed. Gateway has to be in Stopped state." Details=[]

Expected Behavior

The application gateway should be stopped, moved to the new subnet and then restarted.

Actual Behavior

Got an error from Azure that says the application gateway must be stopped before its subnet can be changed. Terraform does not provide the functionality to do so, had to resort to az network application-gateway stop to stop the gateway and then terraform apply again.

Steps to Reproduce

  1. Create a configuration from the the application gateway example (https://www.terraform.io/docs/providers/azurerm/r/application_gateway.html#example-usage)
  2. terraform apply
  3. Update configuration to move gateway from subnet-1 to subnet-2.
  4. terraform apply
@achandmsft
Copy link
Contributor

@tombuildsstuff could be related to the other app-gateway issue around subnet deletion? #608

@tombuildsstuff
Copy link
Contributor

@achandmsft kind of, but not really - the field needs to become ForceNew, unless this functionality is available in the Portal. That said, we're unable to add a test case for any fix for this until #608 is resolved unfortunately - (since it causes subnet 'leaks' where they can't be deleted until an unspecified period after the Application Gateway's been deleted) - which is why we can't really add a fix this until #608 is resolved.

@achandmsft achandmsft added this to the 1.4.0 milestone Mar 9, 2018
@achandmsft achandmsft added the M2 label Mar 10, 2018
@tombuildsstuff tombuildsstuff removed this from the 1.4.0 milestone Apr 17, 2018
@tombuildsstuff
Copy link
Contributor

👋

To give an update here: we're still waiting for the Application Gateway API to be fixed before proceeding with any enhancements or bug fixes for this resource; once the API is fixed (I've just requested an update). As such I've de-prioritised this issue for the moment, but we'll circle around and take another look once the API's in a usable state - sorry for the inconvenience here!

Thanks!

@achandmsft achandmsft added this to the Temp/To Be Sorted milestone Apr 19, 2018
@achandmsft achandmsft added the upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR label Apr 19, 2018
@tombuildsstuff tombuildsstuff modified the milestones: Temp/To Be Sorted, Future May 22, 2018
@tombuildsstuff tombuildsstuff removed the M2 label May 22, 2018
@tombuildsstuff
Copy link
Contributor

hi @wimpienortje

Given this issue is blocked on an upstream issue in the Azure API rather than keeping multiple issues open and trying to ensure they all remain up to date - I'm going to close this in favour of #1576 which is the Meta-Issue tracking the Bugs and Enhancements for the Application Gateway Resource. Once the bug in the API is fixed we should be able to take a look into this, but we'll keep track of the status of this issue there for the moment.

Thanks!

@tombuildsstuff tombuildsstuff modified the milestones: Future, Being Sorted Oct 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.
Labels
bug service/application-gateway upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/1.x (legacy)
Projects
None yet
Development

No branches or pull requests

4 participants