Linked serice parameterization for azure synapse

shehan madusanka 0 Reputation points
2024-09-26T06:44:11.3866667+00:00

Hi,

I have an azure data lake gen 2 linked service created with storage account access and template parameter definitions. Json file set with below structure for linked services.

I want to parameterise url and secret name of this linked service through override parameter template. could anyone help with how i might need to change template parameter. Json for this purpose?

User's image

User's image

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,903 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ganesh Gurram 320 Reputation points Microsoft Vendor
    2024-09-27T09:59:51.5833333+00:00

    @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 

    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 

    User's image

    Step3: Now you need to declare the parameters by clicking on ADD dynamic content 

    User's image

    Then defined parameters will be shown below: Select StorageAccountURL

    User's image

    Step4: Create a New Linked service for Azure Key Vault: 

    Click on Parameters and add necessary parameters  + New 

    KeyVaultURL: https://SamplekeyVault.vault.azure.net/

    User's image

    Step5: Add Secret Name by clicking on ADD dynamic content 

    User's image Step6: Test connection and create 

    User's image

    User's image User's image

    Here is the Linked service (Storage account url, Key Vault url and secret name ) parameterization for azure synapse as shown below. 

    User's image

    Step7: Go to the linked service created and click on the Code to view the JSON code. 

    User's image 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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.