To run Azure Functions from Azure Data Factory, we can create an Azure Function Activity. We must create a linked service to the Azure Function for this. Linked Services are similar to connection strings. A linked service contains all the information required to connect and authenticate the data factory with the service or data store that needs to be accessed.
While creating a linked service for Azure Function, there are certain properties that need to be set.
- Type : Set to AzureFunction
- function app url : URL for the Azure Function App
- function key: Access key for the Azure Function
Apart from the above, Microsoft provides a table of Azure Function Activity properties that need to be set:
Property | Description | Allowed values | Required |
name | Name of the activity in the pipeline | String | yes |
type | Type of activity is ‘AzureFunctionActivity’ | String | yes |
linked service | The Azure Function linked service for the corresponding Azure Function App | Linked service reference | yes |
function name | Name of the function in the Azure Function App that this activity calls | String | yes |
method | REST API method for the function call | String Supported Types: “GET”, “POST”, “PUT” | yes |
header | Headers that are sent to the request. For example, to set the language and type on a request: “headers”: { “Accept-Language”: “en-us”, “Content-Type”: “application/json” } | String (or expression with resultType of string) | No |
body | body that is sent along with the request to the function api method | String (or expression with resultType of string) or object. | Required for PUT/POST methods |
Table Source: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-azure-function-activity
Azure Function activity also supports other features such as routing, queries and durable functions which will be discussed in a future post.
One thought on “Azure Data Factory Azure Function Activity”