EDIT: Pipeline executes fine and the behavior is observed only when testing connection...
I am trying to parametrize the Secret Name value in a linked service. When using a LS parameter, this works fine:
If, I only use the concat function, concatenating two strings this also works fine:
But when I try to use a LS parameter in the function, I get an error:
Error thrown:
The parameters and expression cannot be resolved for schema operations. Error Message: { "message": "ErrorCode=InvalidTemplate, ErrorMessage=The template function 'linkedService' is not defined or not valid." } Activity ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx
Parameter is a string:
Any ideas what did I do wrong?
I have tried changing the .json directly but outcome is the same.
I have also tried packing the parameter in curly brackets, like so: @{concat(linkedService().ServicePrincipalId,'-password')}
In general, the above occurs when we use a linked service parameter in the dynamic expression without creating.
In this case, I have reproduced the same scenario, and these are my observations.
When the same parameters are used for both Service principal ID and Secret name, I got this error. This is also only when using it with concat()
.
You can see the connection is successful when both parameters are different even though the expression is same. The values for both parameters are same.
I had tested this with different parameter names, and it resulted same.
Also, when concatenating this using string interpolation expression like @{linkedService().ServicePrincipalId}-password
, it is working fine.
As the pipeline execution is fine, this might be a bug in a parameterized Key vault linked service test connection.
Using different parameters or string interpolation can act as a temporary workaround for this.