Custom logic written in JavaScript and registered with a Cosmos DB container, callable only from queries. Calling one raises the request unit charge.
Also called user-defined function.
Read more: Microsoft Learn
In the Ultra Transcenders books
AI-200DP-750DP-600DP-700DP-800
Each book explains UDF in context, with comparison tables and the common traps.
Terms in this definition
- Cosmos DB
NoSQL database distributed globally, offering writes in multiple regions, automatic indexing and latency below 10 ms.
- Container
Something that groups data. Blob Storage containers sit inside a storage account and hold blobs much as folders hold files; Cosmos DB containers hold items and set the scope for partitioning and throughput.
- RU
Request unit, the measure in which Azure Cosmos DB throughput is expressed. Analytical queries through Synapse Link use none of the transactional store's RUs.
Related terms
- ABAC policy
Governed tags drive this kind of Unity Catalog rule: when a table or column has tags that satisfy its
WHENandMATCH COLUMNSconditions, a row filter or column mask UDF is put on it automatically. Policies are written withCREATE POLICYand can sit on a metastore, catalog, schema or table. - GETDATE
A T-SQL function giving the database system's current date and time as datetime, with GETUTCDATE returning the UTC equivalent. NEWID isn't allowed inside a user-defined function, but GETDATE is.
- NEWID
Returns a random uniqueidentifier. The values are not sequential, so indexes on them become fragmented; it also can't be called from within a user-defined function.
- PREDICT
A Fabric function for scoring MLflow models in batches from a notebook, provided the models have signatures; you can call it via MLFlowTransformer, Spark SQL or a PySpark UDF. Fabric Warehouse does not support the T-SQL PREDICT statement.
- Stored function
Reusable KQL logic saved in the database schema as a user-defined function, using .create-or-alter function or .create function. A function declared with let, by contrast, is query-defined and only exists while that one query runs.