ADF V2 creating a Generic Linked Service framework

AzeemK 516 Reputation points
2020-12-26T05:57:19.187+00:00

I am creating a parameterized Linked Service connection frame work for ADF V2 Flat file sources below is my advanced JSON script

I am getting this error while publishing the linked Service

The property 'userid' in the payload cannot be null or empty.

any idea why ??

{
    "name": "LS_FileServer",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {

"parameters": {
            "FileServerPath": {
                "type": "String",
                "defaultValue": "\\\\tmdwmart\\Inbound_Production\\MCF"
},
"File_Name": {
                "type": "String",
                "defaultValue": "AccessValue.csv"
},

    "user_name": {
                "type": "String",
                "defaultValue": "tbecu\\khanaz"
            },
"kv_secret": {
                "type": "string",
                "defaultValue": "MCFAccessValue"
            }
},
        "annotations": [],
        "type": "FileServer",
        "typeProperties": {
      "connectionString": "Integrated Security=True;Data Source=@{linkedService().FileServerPath };Initial Catalog=@{linkedService().File_Name}",
            "UserName": "@{linkedService().user_name}",
            "password": {
                "type": "AzureKeyVaultSecret",
                "store": {
                    "referenceName": "AzureKeyVault2",
                    "type": "LinkedServiceReference"
                },
                "secretName": {
                    "value": "@linkedService().kv_secret",
                    "type": "Expression"
                }
            }



        },
        "connectVia": {
            "referenceName": "WSRB08968",
            "type": "IntegrationRuntimeReference"
        }
    }
}
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,664 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AzeemK 516 Reputation points
    2021-01-04T21:11:53.573+00:00

    I worked with Martin jaffer from MS to get this resolved.
    Below is the correct script which corrected the error

    "name": "FileServer1",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
    "type": "FileServer",
    "parameters": {
    "FileServerPath": {
    "type": "String",
    "defaultValue": "\\tmdwmart\Inbound_Production\MCF"
    },
    "File_Name": {
    "type": "String",
    "defaultValue": "AccessValue.csv"
    },
    "user_name": {
    "type": "String",
    "defaultValue": "tbecu\khanaz"
    },
    "kv_secret": {
    "type": "string",
    "defaultValue": "MCFAccessValue"
    }
    },
    "annotations": [],
    "typeProperties": {
    "host": "@{linkedService().FileServerPath}",
    "userId": "@{linkedService().user_name}",
    "password": {
    "type": "AzureKeyVaultSecret",
    "store": {
    "referenceName": "kv_asap",
    "type": "LinkedServiceReference"
    },
    "secretName": {
    "value": "@linkedService().kv_secret",
    "type": "Expression"
    }
    }
    },
    "connectVia": {
    "referenceName": "WSRB08968",
    "type": "IntegrationRuntimeReference"
    }
    }
    }

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.