hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.53k stars 4.61k forks source link

Managed virtual networking in azure data factory not setting correctly #12949

Open michael-kolpin-bt opened 3 years ago

michael-kolpin-bt commented 3 years ago

This actually, doesn't work - created Integrated Runtime has Virtual network configuration=Disable.

resource "azurerm_data_factory" "adf" {
  name                   = "some-adf"
  location               = "westeurope"
  resource_group_name    = azurerm_resource_group.rg.name
  public_network_enabled = false
  managed_virtual_network_enabled  = true

  identity {
    type = "SystemAssigned"
  }
}

resource "azurerm_resource_group" "rg" {
  name     = "adf-rg"
  location = "westeurope"
}

image

This still seems to be wrongly deploying the ADF instance. Should this ticket be opened again or is there already a fix to be deployed?

Originally posted by @michael-kolpin-bt in https://github.com/hashicorp/terraform-provider-azurerm/issues/10542#issuecomment-891583123

FalekMiah01 commented 2 years ago

I am facing the same issue where Terraform doesn't detect the Managed Virtual Network configuration managed_virtual_network_enabled = true

Any updates when this will be fixed?

aschwenker-insight commented 2 years ago

Digging into how the Azure Portal deploys a Data Factory with a Managed Virtual Network, I discovered Azure is deploying a configuration for the default Integration Runtime behind the scenes.

This led me to a potential workaround. Deploy an Integration Runtime from Terraform named AutoResolveIntegrationRuntime as follows:

resource "azurerm_data_factory_integration_runtime_azure" "main" {
  name                    = "AutoResolveIntegrationRuntime"
  data_factory_id         = azurerm_data_factory.main.id
  location                = "AutoResolve"
  virtual_network_enabled = true
}

This has achieved the desired result of the default Integration Runtime using a Managed Virtual Network. You still need the managed_virtual_network_enabled = true flag set on the Data Factory.

I agree this should happen automatically when the flag is set, but at least it is possible to work around in Terraform without resorting to an ARM template.

garddolau commented 1 year ago

Really annoying to have to put in this workaround, can we please fix root cause: managed_virtual_network_enabled = true

Doesn't work as expected

ratneshkumaryadav commented 1 year ago

I am getting same issue