Open darren-mcdonald opened 2 years ago
Link to demo to recreate the issue - https://github.com/darren-mcdonald/azurerm_app_service_virtual_network_swift_connection_issue
I'm very fresh with Go but I believe the issue stems from here: https://github.com/Azure/azure-sdk-for-go/blob/main/services/network/mgmt/2021-02-01/network/subnets.go#L242
It's using the clients subscriptionID which I presume in this context is that of the app service subscription and not that of the vnet subscription. It feels like a subscriptionId parameter needs to be passed into the function instead. As I say I'm new to Go so I'd welcome any input.
Are there any updates on this?
I am also having this issue, please let us know an update. I'm happy to engage on any level I can to assist resolution.
This is still an issue/occurring using: hashicorp/azurerm v2.91.0
I can confirm that Vnet integration is successfully setup, even though terraform throws an error during the apply.
it looks like the state file doesn't get updated, so later apply runs get a message about needing an import.
Please provide status on this issue.
For me, the apply fails with the error that it can't find find the right RG. But actually it applies the link to the app service successfully anyway so the next apply shows that the connection already exists if we could pass in two providers that'd be the ticket.
Still applies to: Terraform: 1.1.9 AzureRM: 3.5.0
After the first apply you can import it and the error is gone for next applies.
terraform import azurerm_app_service_virtual_network_swift_connection.example /subscriptions/.../...
Yep, this is legitimate issue. Currently using hashicorp/azurerm 3.12.0 and receiving `azurerm_app_service_virtual_network_swift_connection.vnet_integration: Creating... ╷ │ Error: retrieving existing App Service "app-test" (Resource Group "rg-test"): App Service not found in resource group │ │ with azurerm_app_service_virtual_network_swift_connection.vnet_integration, │ on main.tf line 7, in resource "azurerm_app_service_virtual_network_swift_connection" "vnet_integration": │ 7: resource "azurerm_app_service_virtual_network_swift_connection" "vnet_integration" { │ ╵ ERRO[0072] 1 error occurred:
Hitting this exact same issue now and it is blocking deployments. Please help
Hitting this exact same issue now and it is blocking deployments. Please help
Microsoft doesn't care. Simply enable it manually, that's it :) I'm using trrragrunt so I'm just skipping the resource till the better day comes :)
Community Note
Terraform (and AzureRM Provider) Version
Terraform 1.0.7 AzureRM 2.86.0
Affected Resource(s)
azurerm_app_service_virtual_network_swift_connection
Terraform Configuration Files
SCENARIO 1
main.tf
appsub.tf
vnetsub.tf
SCENARIO 2
As above but "azurerm_app_service_virtual_network_swift_connection.example" is created from the default (app service subscription) provider.
Debug Output
SCENARIO 1
SCENARIO 2
Expected Behaviour
SCENARIO 1 & 2 : Terraform does not respond with an error and joins the application to the subnet
Actual Behaviour
SCENARIO 1: Error response saying it cannot find the app service even though the provider is using a service principal with contributor permissions to the apps resource group. I believe it might be looking for the app resource group under the context of the vnet provider subscription rather than the subscription id in the app resource id.
SCENARIO 2 : The app is successfully connected to the subnet but it seems terraform wants to do a refresh on the vnet resource group and cant find it so throws an error. I believe it might be looking for the vnet resource group under the context of the app provider subscription rather than the subscription id in the subnet resource id.
Steps to Reproduce
terraform apply
References