From an On Premise server or even from a VM in Azure (Iaas) I can do it using CLR function, But what about SQL Database (Paas)?
See the following thread for the longer answer:
Does or does not SQL Azure support CLR assemblies?
Not supported at this time - although we're looking at support in Managed Instances (https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/06/13/azure-sql-databases-in-logical-servers-elastic-pools-and-managed-instances/).