Linked Service Can't connect to parametrized KeyVault linked service
Hello,
I need help. Sorry, somewhat long description, but it to the point.
Here is the scenario:
I may have serval Key vaults under my Azure subscription. They are copy of each others except the values of some secrets differ (production vs. Test vs. Dev data etc...)
In the Azure Data Factory, I have a Linked Service defined that connects to the key vault. This linked service is parametrized, taking vault name as an argument.
Then, I have 2 more linked services.
- One to a REST endpoint taking ApiKey from key vault
and - Another one is to the Azure SQL Database, taking database password from the Key vault.
FOR SQLDB linked service, is defined this way:
Here, AZKeyVaultName parameter is used to connect to a keyvault by name. I can use either parameter here or hard code the key vault name (not using linked service parameter). When using parameter, its value gets propagated from particular pipeline, at the run time, which can be a value taken from Global parameters defined for each Data factory environments.
However, the problem is with the REST Linked service. Defined this way
where they Keyvault link is like this:
When in the last picture keyvault name is hardcoded as dmkeyvault1 - everything works correctly. However,
they way I want it is to pass a value to it dynamically, so like above it will accept changing key vault name at run time.
If i have it as in the last picture, I am getting error in trying to connect with the REST Linked service
The error is:
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." }
I do not understand how this is different from what is taking place in the SQLDB Linked Service, where it is working correctly. Having to hard code keyvault name defies the purpose of continuous integration for me.