Function App in Azure Data Factory

One thing that I really like with Data Factory is the possibility to execute a Function App. A Function App is really flexible and can be used to extend the available functionality in Data Factory a lot. You could, for example, process your SSAS Tabular models, do advanced file handling or send emails.

Below are some easy steps on how to execute a Function App within Data Factory.

Search for “Function App” in the search box

Function App 0

Create a new Function App

Function App 1

In this case, I will name it “ADFFunctionApp”. Click on “Create” and wait for it to be created in the background.

When it is created you need to find the host key for the function.

Function App 5

Click on “Function app setting”

Function App 6

Copy the default host key

Then open your Data Factory and add an Azure Function to your canvas.

Function App 2

Click on the Azure Function and create a new linked service.

Function App 3

Fill out required columns to create a new linked service. The function key is the host key that you copied in from your Azure Function.

Function App 3.1

So now we have created a Function App and created a reference to it in our Data Factory. Next will be to create a function. Open your function again.

Function App 4

Click on the “+” next to “Functions”

Function App 7

I will choose “In-portal” in this sample

Function App 8

Click on “Continue”

Function App 9

Choose “Webhook + API”. Open the code. Change the code block as in the screenshot below. Data Factory does not like the return type of the auto-generated code.

Function App 9.1

Then go back to your Data Factory and click on App Function. Choose your function name, set method to “POST” and add the JSON to the “Body”.

Function App 10

Then execute your Data Factory. If everything works out you will get this result

Function App 11

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s