-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
DataFactory azurerm_data_factory_linked_service_azure_sql_database with Managed Identity configuration not working properly with Azure DataFactory DataFlows #14577
Comments
Any updates on this issue? Did you find a way to resolve it? I am currently experiencing the same issue. |
@sfeyaerts At the moment, I am manually removing the "tenant" attribute in the data factory after deployment. Then it works fine. |
I have worked around this by using the custom_linked_service resource "azurerm_data_factory_linked_custom_service" "sql" {
name = "LinkedSql"
data_factory_id = azurerm_data_factory.factory.id
type = "AzureSqlDatabase"
type_properties_json = <<JSON
{
"connectionString": "integrated security=False;encrypt=True;connection timeout=30;data source=${azurerm_mssql_server.server.fully_qualified_domain_name};initial catalog=${azurerm_mssql_database.db.name}"
}
JSON
} Drawback is that the json cannot be validated with the validate command. |
Also you do not have a terraform option to specify a credential, If you want to connect to the Azure Sql using a user assigned credential. Response of az rest: https://learn.microsoft.com/en-us/rest/api/datafactory/linked-services/get?view=rest-datafactory-2018-06-01&tabs=HTTP
I also went the route of the custom_service:
|
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. |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v1.0.7
on linux_amd64
Affected Resource(s)
azurerm_data_factory_linked_service_azure_sql_database
Terraform Configuration Files
Debug Output
n/a
Panic Output
n/a
Expected Behaviour
DataFactory linked service configuration (no "tenant"):
Actual Behaviour
DataFactory linked service configuration:
Steps to Reproduce
Create a DataFactory and a Azure SQL Database together with a linked service via Terraform. DataFactory must have a Managed Identity. Azure SQL Database must have Azure AD Administrator set.
After everything is deployed, create a user for the DataFactory Managed Identity in the Azure SQL Database using "PROVIDER EXTERNAL" e.g. CREATE USER [datafactoryname] FROM EXTERNAL PROVIDER.
Go back to Azure DataFactory and "Test Connection" for the linked service. Connectivity should be fine.
Create an Azure DataFactory DataFlow, with a source set to the linked service Azure SQL Database with Source Type "inline" configuration.
Start debug session for Azure DataFlow.
When debug session is ready, do a connectivity test "Test connection" for the source of the DataFlow configuration.
The connectivity test will fail with
com.microsoft.dataflow.broker.InvalidOperationException: Only one valid authentication should be used for <linkname>. ServicePrincipalAuthentication is invalid. One or two of servicePrincipalId/key/tenant is missing. - RunId: xxxx
Go to DataFactory linked service settings, edit the linked service Azure SQL Database in JSON view and remove
"tenant":""
.Go back to the DataFlow change the source to nothing and back to the linked service Azure SQL Database (DataFactory needs to recognize the change or it will fail again).
Do a connectivity test "Test connection" for the source of the DataFlow configuration. This time the test will pass.
I tried to add the actual tenant id, like
"tenant":"some-tenant-id"
, this does not help. Only removing the"tenant":""
statement helps. I checked how the linked service would look like, if it is created via the web-based management. It does not contain the"tenant":""
statement.What I don't know is, if the
"tenant":""
statement can be influenced by the Terraform provider or if it is a problem with Microsoft ARM or CLI? I can raise a ticket for Azure Support, if the latter is the case.Important Factoids
n/a
References
n/a
The text was updated successfully, but these errors were encountered: