New-AzDataFactoryV2LinkedServiceEncryptedCredential Data Factory Integration Runtime with File System: Encryption of password

Horatiu Ripa 1 Reputation point
2020-11-26T15:33:48.76+00:00

Here's the definition json:

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

"properties": {
    "annotations": [],
    "type": "FileServer",
    "typeProperties": {
        "host": "C:\\DataFolder",
        "userId": "MyUser",
        "passwword":
            {"value" :"MyPassword",
            "type": "SecureString"}
    },
    "connectVia": {
        "referenceName": "TheWorkingIR",
        "type": "IntegrationRuntimeReference"
    }
  }

}

Here's the PS command:
New-AzDataFactoryV2LinkedServiceEncryptedCredential -DataFactoryName 'DFMREDemo' -File './LSHoratiuLocal.json' -IntegrationRuntimeName 'TheWorkingIR' -ResourceGroupName 'HoratiuRipa'> 'encrypted.json'

Tried with -File, -DefinitionFile and so on.

It asks for confirmation for encrypting than it doesn't simply work, it doesn't throw an error, just writes "New-AzDataFactoryV2LinkedServiceEncryptedCredential:" in red. Is the .json definition ok?

Set-AzDataFactoryV2LinkedService -ResourceGroupName "HoratiuRipa" -DataFactoryName "DFMREdemo" -Name "LSLocalFileServer" -DefinitionFile "./LSHoratiuLocal.json"
Works, but the password is incorrect

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,958 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Paul Elliot 1 Reputation point
    2021-02-05T15:47:51.147+00:00

    I had the exact same error as OP. This took me almost all day to work out so thought I would share my solution for anyone else that gets here.

    I was running the commandlet from powershell locally and in order to successfully encrypt credentials I needed to enable "remote access from intranet" on the local IR.

    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.