Closed BrandonStiff closed 7 months ago
Same issue here, but I already have the secondary IP and the backend pool defined, but I get the error adding the outbound rule.
https://docs.microsoft.com/en-us/azure/load-balancer/outbound-rules#limitations
Outbound rules can only be applied to primary IP configuration of a NIC. You can't create an outbound rule for the secondary IP of a VM or NVA. Multiple NICs are supported
This is a limitation in Azure, that's been known about for years unfortunately.
Thank you for taking the time to raise this! I am going to close this with @jdelforno‘s response as an answer. If you have future questions, I suggest using the Community Resources, such as the Azure Provider forum.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Summary
I can't add a secondary IP configuration on a NIC if it's part of an Azure Load Balancer back end with an outbound rule assigned using Terraform.
It's important to note that you can manually go into the Azure Portal and add a secondary IP configuration exactly as configured in Terraform without issue.
Terraform (and AzureRM Provider) Version
Terraform v0.13.0
Affected Resource(s)
azurerm_network_interface.primary
Terraform Configuration Files
Debug Output
https://gist.github.com/BrandonStiff/4bdc1fcc1e5b7bc237e4754617bba8fb
Expected Behavior
Both Terraform apply commands should succeed and add a second IP configuration to the network interface.
Actual Behavior
The first Terraform apply succeeds, but after commenting in the secondary IP configuration and running again, the second apply fails with the following error:
Steps to Reproduce
terraform apply
terraform apply
Manual Workaround
You can do this manually via the portal without issue:
No errors occur.
Community Note