Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.61k stars 5.02k forks source link

Cannot pass via the SDK linkedService parameter value in DataFlow run activity #23298

Open bensalem22 opened 1 year ago

bensalem22 commented 1 year ago

To Reproduce Steps to reproduce the behavior:

  1. Create a DatFlow with an inline "Delta" Sink. The inline sink uses a LinkedService that accepts a parameter (e.g. storage account key)
  2. Create programmatically a pipeline to run the dataflow, the value for the linked service parameters is ignored by the API

Expected behavior Linked Service parameter populated

Screenshots

image

Additional context adf_client.pipelines.create_or_update( resource_group_name=rg_name, factory_name=df_name, pipeline_name=p_name, pipeline={ "properties": { "activities": [ { "name": dataflow_name, "type": "ExecuteDataFlow", "dependsOn": [], "userProperties": [], "typeProperties": { "dataflow": { "referenceName": dataflow_name, "type": "DataFlowReference", "parameters": { "dest_container": { "value": "'@{pipeline().parameters.dest_container}'", "type": "Expression", }, "dest_path": { "value": "'@{pipeline().parameters.dest_path}'", "type": "Expression", }, }, "datasetParameters": { "source1prog": { "db_name": "@pipeline().parameters.db_name", "source_schema_name": "@pipeline().parameters.source_schema_name", "source_table_name": "@pipeline().parameters.source_table_name", "db_conn": "@pipeline().parameters.db_conn", "db_user": "@pipeline().parameters.db_user", "db_password": "@pipeline().parameters.db_password", } }, "linkedServiceParameters": { "sink1prog": { "linkedService": {"secret_name": "adls-key"} } }, }, "compute": {"coreCount": 8, "computeType": "General"}, "traceLevel": "Fine", }, } ], "parameters": { "db_conn": { "type": "string", }, "db_name": {"type": "string", "defaultValue": "DataIngestion"}, "db_keyvault": { "type": "string", }, "db_user": {"type": "string", "defaultValue": "apadmin"}, "db_password": { "type": "string", }, "dest_type": {"type": "string", "defaultValue": "adls"}, "dest_container": {"type": "string", "defaultValue": "hbstest"}, "dest_path": {"type": "string", "defaultValue": "hbsdelta"}, "dest_format": {"type": "string", "defaultValue": "delta"}, "source_schema_name": { "type": "string", }, "source_table_name": { "type": "string", }, "column_dict": {"type": "string", "defaultValue": "*"}, "source_where_condition": { "type": "string", }, }, "annotations": [], }, "type": "Microsoft.DataFactory/factories/pipelines", }, )

kashifkhan commented 1 year ago

Hi @bensalem22 , thank you for the feedback. We will investigate soon and get back to you asap.

Wzb123456789 commented 1 year ago

Hi @bensalem22 thanks for your feedback.

According to my investigation, since the linkedService defined by swagger is a read-only parameter, it cannot be changed through the SDK. https://github.com/Azure/azure-rest-api-specs/blob/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/datafactory.json#L1846 Since the SDK is generated by swagger, the SDK cannot modify a read-only parameter.

ghost commented 1 year ago

Hi @bensalem22. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

bensalem22 commented 1 year ago

@Wzb123456789 How can I use a parametrized linked service with a data flow then? populating a value in the UI is straightforward, why would it be impossible to pass a value via the API/SDK?

Wzb123456789 commented 1 year ago

Maybe you can go here and resubmit your question.

Because the SDK is generated by swagger, swagger defines this parameter as a read-only parameter, and the SDK API cannot be changed.