@shehan madusanka - Thanks for the question and using MS Q&A platform.
Here are the steps to create Linked service ( url and secret name ) parameterization for azure synapse.
Step1: To create a parameterized for Key vault URL and secret, you need to first create parameters as shown:
Key: Value
- SecretName: Sampleadlsgen2
- KeyVaultURL: https://Sample.vault.azure.net/
- StorageAccountURL: https://samplegen2.dfs.core.windows.net/
Step2: Create a linked ADLS Gen2 and expand parameters and declare the above parameters created in step1:Click on Parameters and add necessary parameters + New
- SecretName: Sampleadlsgen2
- KeyVaultURL: https://Sample.vault.azure.net/
- StorageAccountURL: https://samplegen2.dfs.core.windows.net/
Step3: Now you need to declare the parameters by clicking on ADD dynamic content
Then defined parameters will be shown below: Select StorageAccountURL
Step4: Create a New Linked service for Azure Key Vault:
Click on Parameters and add necessary parameters + New
KeyVaultURL:
https://SamplekeyVault.vault.azure.net/
Step5: Add Secret Name by clicking on ADD dynamic content
Step6: Test connection and create
Here is the Linked service (Storage account url, Key Vault url and secret name ) parameterization for azure synapse as shown below.
Step7: Go to the linked service created and click on the Code to view the JSON code.
Here is the JSON code to create Linked service ( url and secret name ) parameterization for azure synapse:
{
"name": "AzureDataLakeStorage1",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"parameters": {
"StorageAccountURL": {
"type": "string",
"defaultValue": "https://sampleadlsgen2.dfs.core.windows.net/"
},
"KeyVaultURL": {
"type": "string",
"defaultValue": "https://samplekeyvault.vault.azure.net/"
},
"SecretName": {
"type": "string",
"defaultValue": "sampleadlsgen2AccountKey"
}
},
"annotations": [],
"type": "AzureBlobFS",
"typeProperties": {
"url": "@{linkedService().StorageAccountURL}",
"accountKey": {
"type": "AzureKeyVaultSecret",
"store": {
"referenceName": "AzureKeyVault1",
"type": "LinkedServiceReference",
"parameters": {
"KeyVaultURL": "https://samplekeyvault.vault.azure.net/"
}
},
"secretName": {
"value": "@linkedService().SecretName",
"type": "Expression"
}
}
}
}
}
Advanced authoring: You can parameterize the linked service by editing the JSON on UI:
- In linked service creation/edit blade -> expand "Advanced" at the bottom -> check "Specify dynamic contents in JSON format" checkbox -> specify the linked service JSON payload.
- Or, after you create a linked service without parameterization, in Management hub -> Linked services -> find the specific linked service -> click "Code" (button "{}") to edit the JSON.
Refer to the JSON sample to add parameters section to define parameters and reference the parameter using @{linkedService().paramName}
.
For more details, refer to Parameterize linked services in Azure Data Factory and Azure Synapse Analytics
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.