5

Azure Data Factory

 3 years ago
source link: https://mrpaulandrew.com/2020/07/14/how-to-use-specify-dynamic-contents-in-json-format-in-azure-data-factory-linked-services/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How To Use ‘Specify dynamic contents in JSON format’ in Azure Data Factory Linked Services

Make any Azure Data Factory Linked Service dynamic!

In a few different community circles I’ve been asked ‘how to handle dynamic Linked Service connections in Azure Data Factory if the UI doesn’t naturally support the addition of parameters’. Depending on the Linked Service the support for this varies.

Well, the answer, or should I say, Microsoft’s quick hack answer, is use the ‘Specify dynamic contents in JSON format’ option available for all Linked Services regardless of there type/popularity. This feature enables an empty text box where you can define anything about the Linked Service. It also removes all other attributes from the Linked Service connection panel, except Title and Description.

What this setting does is basically allow you to write you own JSON definition (in full) for the intended Linked Service. This then gives you the flexibility to parameterise anything in the key/value pair structure and means you don’t need to worry about Data Factory naturally supporting the Linked Service being dynamic via the usual developer canvas and expression builder. The down side that I’ve already alluded to, is that if you only want one value in the Linked Service to be dynamic you’ll have to provide the complete JSON definition for everything.

To be explicit about this behaviour if you haven’t seen it before…

If you want to inject parameters into a Linked Service for an Azure SQLDB, you get the full UI and expression builder support, as follows:

I blogged about doing this in more detail for an Azure SQLDB here if you want to look back.


However, in the equivalent panel for an Azure Key Vault Linked Service connection you get nothing, no expression builder support.


That is, unless you expand the Advanced section and tick Specify dynamic contents in JSON format. Then the UI panel changes to the following.

What we can then do is add the complete JSON definition for the Linked Service including any required parameters.

Let’s say, for example, we want the Key Vault URL to be dynamic, you could add the JSON like this:

Then, like other Data Factory components, the parameter value would bubble up wherever you try to use the dynamic content. In the case of the Key Vault Linked Service, even when you hit Test Connection.

adf-ls-dynamic-content-kv-json-1.png?w=700&h=260

Give it a try!

Dynamic values for all your Linked Services using custom JSON definitions via the ‘Specify dynamic contents in JSON format’ tick box  🙂

Hope this helps.

Many thanks for reading.

Tagged Azure Data Factory, Dynamic ADF Pipelines

Principal consultant and architect specialising in big data solutions on the Microsoft Azure cloud platform.

Data engineering competencies include Azure Data Factory, Data Lake, Databricks, Stream Analytics, Event Hub, IoT Hub, Functions, Automation, Logic Apps and of course the complete SQL Server business intelligence stack.

Many years’ experience working within healthcare, retail and gaming verticals delivering analytics using industry leading methods and technical design patterns.

STEM ambassador and very active member of the data platform community delivering training and technical sessions at conferences both nationally and internationally.

Father, husband, swimmer, cyclist, runner, blood donor, geek, Lego and Star Wars fan! View all posts by mrpaulandrew


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK