none
ADF Concating string -- cant Publish

    Question

  • concat Strings in ADF

    Hi

    I have a Parameter in my Pipeline called “PAR_Path”  and it has the value of

    “raw/Folder1”

    Now I have a ForEach Loop and within it I have a Web Activity that needs a string within the body that (I do get a warning) looks like

    {"blobname":"raw/Folder1/Myfile.txt"}

    I tested it and it worked

    Then I changed the above string to

    @concat('{"blobname":"','raw/Folder1/',item().name,'"}')

    Again it worked,

    and finally coming to the point

    I change the code to

    @concat('{"blobname":"' , @pipeline().parameters.PAR_Path , '/' , item().name,'"}')

    It works but when I try to “publish All” it I get the error

    Publishing

    Error while publishing: At Least one resource deployment operation failed Please list deployment operation for details, please see htps://aka.ms/arm-debug for usage details.

    So now I have to go back to @concat('{"blobname":"','raw/Folder1/',item().name,'"}')

    Why does it work but I cant publish it????

    Thanks


    Sincerely Nik -- Please kindly mark the post(s) that answered your question and/or vote for the post(s). http://sqldataside.blogspot.ca/ (SQL Tabular + PowerShell)

    Wednesday, August 22, 2018 7:48 PM

Answers

  • Hi Nik,
    Please change @concat('{"blobname":"' , @pipeline().parameters.PAR_Path , '/' , item().name,'"}') into @concat('{"blobname":"' ,pipeline().parameters.PAR_Path, '/' , item().name,'"}'). Remember to remove the blank space between 'parameters.PAR_Path' and ',' .

    We can include only one '@' in an expression and the blank space after parameter name caused the issue.
    Thanks. :)


    Thursday, August 23, 2018 2:02 AM

All replies

  • Hi Nik,
    Please change @concat('{"blobname":"' , @pipeline().parameters.PAR_Path , '/' , item().name,'"}') into @concat('{"blobname":"' ,pipeline().parameters.PAR_Path, '/' , item().name,'"}'). Remember to remove the blank space between 'parameters.PAR_Path' and ',' .

    We can include only one '@' in an expression and the blank space after parameter name caused the issue.
    Thanks. :)


    Thursday, August 23, 2018 2:02 AM
  • In addition to what Wang suggested, you could also use string interpolation expression instead of concat function:

    {"blobname":"@{pipeline().parameters.PAR_Path}/Myfile.txt"}

    Thursday, August 23, 2018 4:34 AM
  • Thanks for the reply

    i am going to give it a test

    and for your suggestion, i am using "item().name" from a ForEach Loop, so can i use a tring interpolation expression instead  ???????

    please wait let me test it

    Thanks


    Sincerely Nik -- Please kindly mark the post(s) that answered your question and/or vote for the post(s). http://sqldataside.blogspot.ca/ (SQL Tabular + PowerShell)

    Thursday, August 23, 2018 11:35 AM
  • I just checked my codes that i was testing with and yes i only had one @ , in my question by mistake i had added an extra @, thank you

    But the main answer is the space that you had mentioned, yes having an space is causing the issue of me not been able to Publish All, and i think the answer is arround

    1- the space issue that you had mentioned, thank you again

    2- In the Web Activity in the Settings and in the Body, the compiler converts the code into other format that is SPACE sensitive, that is what i think is happening.

    Thank Wang


    Sincerely Nik -- Please kindly mark the post(s) that answered your question and/or vote for the post(s). http://sqldataside.blogspot.ca/ (SQL Tabular + PowerShell)

    Thursday, August 23, 2018 11:48 AM
  • the answer is

    @concat('{"blobname":"',pipeline().parameters.PAR_Path,'/',item().name,'"}')

    DO NOT USE SPACE 


    Sincerely Nik -- Please kindly mark the post(s) that answered your question and/or vote for the post(s). http://sqldataside.blogspot.ca/ (SQL Tabular + PowerShell)

    Thursday, August 23, 2018 11:53 AM