Hello Benedikt !
Thank you for posting on Microsoft Learn.
ADF doesn't natively support writing JSON to Table Storage but if you are comfortable with Azure functions you can create a HTTP trigger which supports upsert, and accepts a JSON POST body.
import logging
import os
from azure.data.tables import TableServiceClient
import azure.functions as func
import json
connection_string = os.environ["AzureWebJobsStorage"]
table_name = os.environ["TableName"]
def main(req: func.HttpRequest) -> func.HttpResponse:
try:
data = req.get_json()
table_client = TableServiceClient.from_connection_string(conn_str=connection_string)
table = table_client.get_table_client(table_name=table_name)
entity = {
"PartitionKey": data["PartitionKey"],
"RowKey": data["RowKey"],
"state": data["state"],
"body": data["body"]
}
table.upsert_entity(entity)
return func.HttpResponse("Success", status_code=200)
except Exception as e:
logging.error(str(e))
return func.HttpResponse("Error: " + str(e), status_code=500)
On the Azure Function, you need to enable Azure AD authentication and set it to accept only requests from authenticated users (disable anonymous).
Then assign System-Assigned Managed Identity a role in your Function App (for example Function App Contributor or custom RBAC that allows Microsoft.Web/sites/functions/invoke/action
).
Then last step in the ADF Pipeline, use a Web Activity with the following configuration :
- URL:
https://<functionapp>.azurewebsites.net/api/<function_name>
- Method:
POST
- Authentication:
MSI
- Resource:
https://<functionapp>.azurewebsites.net
- Body: pass your JSON string (with
PartitionKey
,RowKey
...)
{
"PartitionKey": "Logs",
"RowKey": "20250607-123",
"state": "Success",
"body": "Pipeline completed successfully"
}