Azure Data warehouse - User defined function issues
Functions in Azure DW don't support select statements that access tables like in your use case, see CREATE FUNCTION (SQL Data Warehouse):


  function_body
      Specifies that a series of Transact-SQL statements, which do not reference database data (tables or views), define the value of the function.


Could you double check that function is created in DW?