Welcome to new things

[Technical] [Electronic work] [Gadget] [Game] memo writing

How to pass parameters from Azure Node SDK to Azure Data Factory pipeline

This is a note of what I am trying to do with the Azure Node SDK, trying to parameterize and execute on the Azure Data Factory pipeline.

Pipeline execution of Data Factory is performed by the "createRun" method of the "pipelines" member of the "DataFactoryManagemantClinet" object.

However, the reference does not mention "options?: Object" as a parameter for "createRun".

Azure Data Facotry Node SDK createRun parameter

https://docs.microsoft.com/ja-jp/javascript/api/azure-arm-datafactory/pipelines?view=azure-node-latest#createrun-string--string--string--object-

I tried passing the parameters to "options" as they are in JSON, but it failed. I tried to stick with it, but there was no further information, so I had to look at the source.

As a result, the solution was totally different and was as follows.

Solution

  • Pass parameters in JSON to the "parameters" element of the fourth "options" argument of createRun()
  • Each parameter value of "parameters" is passed as a JavaScript object.

The specific parameters to be passed are as follows.

// Pipeline Parameters
const params = {
    val_str: new String('パラメータ値'),   // Cannot just use 'parameter value'.
    val_number: new Number(123)  // 123 alone is not enough.
};

const result = await client.pipelines.createRun(
    RESOURCE_GROUP_NAME,
    DATA_FACTORY_NAME,
    PIPELINE_NAME,
    {
        parameters: params
    }
);

The value of the parameter Each parameter value of "parameters" is passed as a JavaScript object. cannot be a direct value such as "parameter value" for strings or "123" for numbers, but must be set as a String object for strings or a Number object for numbers.

Lessons

I wonder if the manuals are not up to date.

Since Azure is updated so frequently, it seems unlikely that the manual will be maintained in the future.

Even though it is an SDK, what it does is a wrapper for the API and not very complicated, so I thought I would quickly refer to the source when I get stuck on references.

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com