Facing issues with New-AzureRmDataFactoryV2LinkedServiceEncryptedCredential


  • Hi,

    I'm trying to encrypt linked service on the IR node using New-AzureRmDataFactoryV2LinkedServiceEncryptedCredential through powershell but it's failing due to some jsonExceptionReader.

    I have created a json file as dof_ls_file.json as below. I have checked all the syntax of json and everything is right but getting error evrytime i run. Error is attached below

        "name": "dof_ls_file",
        "properties": {
            "type": "FileServer",
            "typeProperties": {
                "host": "\\\\fileserver_name\\folder_name",            
                "userid": "userid",
                "password": {
                    "type": "SecureString",
                    "value": "xxxxx"
            "connectVia": {
                "referenceName": "coe-eu-ir",
                "type": "IntegrationRuntimeReference"

    The error from command is as below:

    New-AzureRmDataFactoryV2LinkedServiceEncryptedCredential : Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
    At line:1 char:1
    + New-AzureRmDataFactoryV2LinkedServiceEncryptedCredential -DataFactory ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [New-AzureRmData...yptedCredential], JsonReaderException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.DataFactoryV2.NewAzureDataFactoryLinkedServiceEncryptedCredentialCommand

    Command :

    New-AzureRmDataFactoryV2LinkedServiceEncryptedCredential -DataFactoryName $dataFactoryName -ResourceGroupName $resourceGroupName -IntegrationRuntimeName $integrationRuntimeName -DefinitionFile ".\dof_ls_file.json" > ".\dof_ls_file_encrypted.json"
    Please help me to fix this error!


    Wednesday, May 23, 2018 1:11 PM

All replies

  • Are you trying to create a linked service for accessing your azure blob file?
    Wednesday, May 23, 2018 11:22 PM
  • Creating Linked service for On-prem File Storage to Azure Data Lake Store through data factory. We got a request from clients that not to create linked service within data factory hence we trying to create from one of the on-prem node using New-AzureRmDataFactoryV2LinkedServiceEncryptedCredential command through powershell


    Thursday, May 24, 2018 8:00 AM
  • Hi

    Once, after Encryption(any specific algorithm you are using to encrypt) If So, Where were you using decryption-logic in this your command.



    Thursday, May 24, 2018 9:39 AM
  • Hi,

    we are following  the azure documentation (see below for link) for the encryption part. Encryption part is taken care by the command and the output json file will be having encrypted credentials and decryption is done by data factory during execution.


    This command was working fine earlier but in recent times it is throwing this weird error. 


    Thursday, May 24, 2018 9:51 AM
  • Hi Nihar,

    I was not able to replicate your issue.  I was able to create the encrypted Linked Service credential successfully, connecting via my IR, using your code, but changing out some of the values to fit my own setup.  

    I think the JSON parse problem might be with the Powershell environment you are running the command from.  I would try the command again from a fresh Powershell environment, and if that still doesnt work, could you set this Powershell environment variable and run your command again:

    $DebugPreference = "Continue"

    Tuesday, May 29, 2018 11:32 PM