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.6k stars 4.64k forks source link

ADF to DB connectivity is not working when tenant_id is provided in LS configuration - azurerm_data_factory_linked_service_azure_sql_database #18681

Closed JaydeepUniverse closed 1 year ago

JaydeepUniverse commented 2 years ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.3

AzureRM Provider Version

v3.13.0

Affected Resource(s)/Data Source(s)

Azure data factory, SQL Database

Terraform Configuration Files

resource "azurerm_data_factory_linked_service_azure_sql_database" "sqldatabase_linked_service_10102022" {
  count = (var.subResourcesInfo.sqlDatabaseName != "") ? 1 : 0
  depends_on = [azurerm_data_factory_integration_runtime_azure.autoresolve_integration_runtime,
  azurerm_data_factory_managed_private_endpoint.sqlserver_managed_endpoint]

  name            = "AzureSqlDatabase10102022"
  data_factory_id = azurerm_data_factory.datafactory.id

  integration_runtime_name = "AutoResolveIntegrationRuntime"
  use_managed_identity     = true
  connection_string = format("Integrated Security=False;Data Source=%s.database.windows.net;Initial Catalog=%s;",
    var.subResourcesInfo.sqlServerName,
  var.subResourcesInfo.sqlDatabaseName)
}

Debug Output/Panic Output

Will get it soon

Expected Behaviour

Issue is ADF to DB connectivity, error:

Operation on target DWH_DF_aaa failed: {'StatusCode':'DFExecutorUserError','Message':'Job failed due to reason: com.microsoft.dataflow.broker.InvalidOperationException: Only one valid authentication should be used for AzureSqlDatabase. ServicePrincipalAuthentication is invalid. One or two of servicePrincipalId/key/tenant is missing.','Details':''}

When we created this LS using TF, we get tenant="" in ADF LS Json file which we suspect that causing issue of above error.

When we created the same LS directly on ADF UI, then there is no field of tenant="" in its json file, and if we use this LS in dataflow/pipeline then communication works from ADF to DB.

Expected behavior should be, if we don't provide tenant_id parameter in TF code then in json also should not show tenant="" which then works for connectivity.

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

JaydeepUniverse commented 1 year ago

Hello, is there anyone looking into this issue?

fmms commented 1 year ago

I think this is the same as https://github.com/hashicorp/terraform-provider-azurerm/issues/14577

JaydeepUniverse commented 1 year ago

I think this is the same as #14577

Yes it is. Thanks for linking. I see no answer on https://github.com/hashicorp/terraform-provider-azurerm/issues/14577 as well, it was reported 1 year back. Hopefully will get reply very soon.

rcskosir commented 1 year ago

@JaydeepUniverse Thank you for opening this issue, and thank you @fmms for finding the related issue #14577. We try to keep only 1 issue open for a given topic/bug to consolidate effort and updates, so I ask for you to please subscribe to the older issue #14577 and use the 👍 to indicate you are also facing the same issue. As such, I am going to close this issue as a duplicate.

github-actions[bot] commented 5 months ago

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.